Skip to content

Commit f3a74f7

Browse files
committed
🎉 feat: 1.3
1 parent 3ae8e0f commit f3a74f7

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

docs/essential/plugin.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ const plugin = new Elysia()
597597
return { hi: 'ok' }
598598
})
599599
.get('/child', ({ hi }) => hi)
600-
.as('plugin') // [!code ++]
600+
.as('scoped') // [!code ++]
601601

602602
const main = new Elysia()
603603
.use(plugin)
@@ -621,12 +621,12 @@ const plugin = new Elysia()
621621
.onBeforeHandle(() => { console.log('called') })
622622
.get('/ok', () => 'ok')
623623
.get('/not-ok', () => 1)
624-
.as('plugin') // [!code ++]
624+
.as('scoped') // [!code ++]
625625

626626
const instance = new Elysia()
627627
.use(plugin)
628628
.get('/no-ok-parent', () => 2)
629-
.as('plugin') // [!code ++]
629+
.as('scoped') // [!code ++]
630630

631631
const parent = new Elysia()
632632
.use(instance)
@@ -663,7 +663,7 @@ const plugin = new Elysia()
663663
return 'hi'
664664
})
665665
.get('/child', 'child')
666-
.as('plugin')
666+
.as('scoped')
667667

668668
const main = new Elysia()
669669
.use(plugin)

docs/tutorial.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,7 @@ export const getUserId = new Elysia()
16291629
username: session[token.value]
16301630
})
16311631
)
1632-
.as('plugin') // [!code ++]
1632+
.as('scoped') // [!code ++]
16331633

16341634
export const user = new Elysia({ prefix: '/user' })
16351635
.use(getUserId)
@@ -1968,7 +1968,7 @@ export const getUserId = new Elysia()
19681968
username: session[token.value]
19691969
})
19701970
)
1971-
.as('plugin')
1971+
.as('scoped')
19721972

19731973
export const user = new Elysia({ prefix: '/user' })
19741974
.use(getUserId)
@@ -2166,7 +2166,7 @@ export const getUserId = new Elysia()
21662166
username: session[token.value]
21672167
})
21682168
)
2169-
.as('plugin')
2169+
.as('scoped')
21702170

21712171
export const user = new Elysia({ prefix: '/user' })
21722172
.use(getUserId)
@@ -2291,7 +2291,7 @@ export const getUserId = new Elysia()
22912291
username: session[token.value]
22922292
})
22932293
)
2294-
.as('plugin')
2294+
.as('scoped')
22952295

22962296
export const user = new Elysia({ prefix: '/user' })
22972297
.use(getUserId)
@@ -2434,7 +2434,7 @@ export const getUserId = new Elysia()
24342434
username: session[token.value]
24352435
})
24362436
)
2437-
.as('plugin')
2437+
.as('scoped')
24382438

24392439
export const user = new Elysia({ prefix: '/user' })
24402440
.use(getUserId)
@@ -2546,7 +2546,7 @@ export const getUserId = new Elysia()
25462546
.resolve(({ store: { session }, cookie: { token } }) => ({
25472547
username: session[token.value]
25482548
}))
2549-
.as('plugin')
2549+
.as('scoped')
25502550

25512551
export const user = new Elysia({ prefix: '/user' })
25522552
.use(userService)
@@ -2793,7 +2793,7 @@ export const getUserId = new Elysia()
27932793
.resolve(({ store: { session }, cookie: { token } }) => ({
27942794
username: session[token.value]
27952795
}))
2796-
.as('plugin')
2796+
.as('scoped')
27972797

27982798
export const user = new Elysia({ prefix: '/user' })
27992799
.use(userService)
@@ -2927,7 +2927,7 @@ export const getUserId = new Elysia()
29272927
.resolve(({ store: { session }, cookie: { token } }) => ({
29282928
username: session[token.value]
29292929
}))
2930-
.as('plugin')
2930+
.as('scoped')
29312931

29322932
export const user = new Elysia({ prefix: '/user' })
29332933
.use(getUserId)

0 commit comments

Comments
 (0)