Skip to content

Commit 2f968e8

Browse files
authored
Merge pull request #99 from Fecony/fix/plugin-page-typos
🔧 fix: plugin page typos and code example
2 parents a7992b5 + 5b54700 commit 2f968e8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/concept/plugin.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ head:
77

88
- - meta
99
- name: 'description'
10-
content: A plugin is a way to decouple logic into smaller parts, defining reusable components across the server. Plugin can register by using `use`, registering a plugin will combine types between plugin and current instance, and the scope of hooks, and schema get merged too.
10+
content: A plugin is a way to decouple logic into smaller parts, defining reusable components across the server. Plugin can be registered by using `use` method, registering a plugin will combine types between plugin and current instance, and the scope of hooks and schema get merged as well.
1111

1212
- - meta
1313
- property: 'og:description'
14-
content: A plugin is a way to decouple logic into smaller parts, defining reusable components across the server. Plugin can register by using `use`, registering a plugin will combine types between plugin and current instance, and the scope of hooks, and schema get merged too.
14+
content: A plugin is a way to decouple logic into smaller parts, defining reusable components across the server. Plugin can be registered by using `use` method, registering a plugin will combine types between plugin and current instance, and the scope of hooks and schema get merged as well.
1515
---
1616

1717
# Plugin
@@ -31,12 +31,12 @@ const app = new Elysia()
3131
.listen(8080)
3232
```
3333

34-
Plugin can register by using `use`.
34+
Plugin can be registered by using `use` method.
3535

36-
Registering a plugin will combine types between plugin and current instance, and the scope of hooks, and schema get merged too.
36+
Registering a plugin will combine types between plugin and current instance, and the scope of hooks and schema get merged as well.
3737

3838
## Separate file
39-
Using plugin pattern, you can define decouple your logic into a separate file.
39+
Using plugin pattern, you can separate your logic into a separate file.
4040
```ts
4141
// plugin.ts
4242
export const plugin = new Elysia()
@@ -66,7 +66,7 @@ const app = new Elysia()
6666
.listen(8080)
6767
```
6868

69-
Functional callback will allows use to access main instance values like routes schema, store.
69+
Functional callback will allow user to access main instance values like routes schema, store.
7070

7171
## Config
7272
You can customize plugin by creating function to return callback which accepts Elysia.
@@ -77,7 +77,7 @@ import { Elysia } from 'elysia'
7777
const plugin = <const Prefix>({
7878
prefix = '/v1'
7979
}: { prefix: Prefix }) => new Elysia({ prefix })
80-
.get(`/${prefix}/hi`, () => 'Hi')
80+
.get(`/hi`, () => 'Hi')
8181

8282
const app = new Elysia()
8383
.use(plugin({

0 commit comments

Comments
 (0)