Skip to content

Commit badc1b7

Browse files
committed
docs: clean up tutorial.md by removing unnecesary texts
1 parent 8379f35 commit badc1b7

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

docs/tutorial.md

+2-12
Original file line numberDiff line numberDiff line change
@@ -1087,9 +1087,7 @@ For **1.** instead of using guard, we could use a **macro**.
10871087
## Plugin deduplication
10881088

10891089
As we are going to reuse this hook in multiple modules (user, and note), let's extract the service (utility) part out and apply it to both modules.
1090-
// @errors: 2538
1091-
// @filename: user.ts
1092-
import { Elysia, t } from 'elysia'
1090+
10931091
```ts twoslash [user.ts]
10941092
// @errors: 2538
10951093
import { Elysia, t } from 'elysia'
@@ -1200,9 +1198,7 @@ export const userService = new Elysia({ name: 'user/service' })
12001198
We have just created a new macro name `isSignIn` that accepts a `boolean` value, if it is true, then we add an `onBeforeHandle` event that executes **after validation but before the main handler**, allowing us to extract authentication logic here.
12011199

12021200
To use the macro, simply specify `isSignIn: true` as follows:
1203-
// @errors: 2538
1204-
// @filename: user.ts
1205-
import { Elysia, t } from 'elysia'
1201+
12061202
```ts twoslash [user.ts]
12071203
// @errors: 2538
12081204
import { Elysia, t } from 'elysia'
@@ -1341,9 +1337,6 @@ Unlike `decorate` and `store`, resolve is defined at the `beforeHandle` stage or
13411337

13421338
This ensures that the property like `cookie: 'session'` exists before creating a new property.
13431339

1344-
// @errors: 2538
1345-
// @filename: user.ts
1346-
import { Elysia, t } from 'elysia'
13471340
```ts twoslash [user.ts]
13481341
// @errors: 2538
13491342
import { Elysia, t } from 'elysia'
@@ -1563,9 +1556,6 @@ export const user = new Elysia({ prefix: '/user' })
15631556

15641557
Alternatively, if we have multiple `scoped` defined, we could use `as` to cast multiple life-cycles instead.
15651558

1566-
// @errors: 2538
1567-
// @filename: user.ts
1568-
import { Elysia, t } from 'elysia'
15691559
```ts twoslash [user.ts]
15701560
// @errors: 2538
15711561
import { Elysia, t } from 'elysia'

0 commit comments

Comments
 (0)