Skip to content

Commit 3ae8e0f

Browse files
committed
📘 doc: release 1.3.0
1 parent 2714cdb commit 3ae8e0f

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

docs/blog/elysia-11.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,7 @@ Adding `as` to guard is useful, because it allow us to apply multiple hooks resp
334334

335335
However, it also allows us to apply `schema` to ensure type safety for all the routes at once.
336336

337-
```typescript twoslash
338-
// @errors: 2304 2345
337+
```typescript
339338
import { Elysia, t } from 'elysia'
340339

341340
const plugin = new Elysia()
@@ -363,8 +362,7 @@ To apply to the parent instance, we need to **"lift the scope up** to the parent
363362

364363
We can achieve this by casting it `**as('plugin')**.
365364

366-
```typescript twoslash
367-
// @errors: 2304 2345
365+
```typescript
368366
import { Elysia, t } from 'elysia'
369367

370368
const plugin = new Elysia()
@@ -391,8 +389,7 @@ The `as` cast will lift all an instance's scope up.
391389
How it work is that, it read all hooks and schema scope, and lift it up to the parent instance.
392390

393391
Which means if you have `local` scope, and want to apply it to the parent instance, you can use `as('plugin')` to lift it up.
394-
```typescript twoslash
395-
// @errors: 2304 2345
392+
```typescript
396393
import { Elysia, t } from 'elysia'
397394

398395
const plugin = new Elysia()
@@ -421,8 +418,7 @@ This will cast **guard's response** and **onBeforeHandle** as `scoped` thus lift
421418
- `plugin` cast event to **scoped**
422419
- `global` cast event to **global**
423420

424-
```typescript twoslash
425-
// @errors: 2304 2345
421+
```typescript
426422
import { Elysia, t } from 'elysia'
427423

428424
const plugin = new Elysia()
@@ -475,8 +471,7 @@ In Elysia 1.0, Elysia will prefers either one of the schema from the scope, and
475471

476472
However, on Elysia 1.1, Elysia will try to reconcile response schema from all scope from each status code and merge them together.
477473

478-
```typescript twoslash
479-
// @errors: 2304 2345
474+
```typescript
480475
import { Elysia, t } from 'elysia'
481476

482477
const plugin = new Elysia()

0 commit comments

Comments
 (0)