You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/concept/plugin.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@ head:
7
7
8
8
- - meta
9
9
- 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.
11
11
12
12
- - meta
13
13
- 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.
15
15
---
16
16
17
17
# Plugin
@@ -31,12 +31,12 @@ const app = new Elysia()
31
31
.listen(8080)
32
32
```
33
33
34
-
Plugin can register by using `use`.
34
+
Plugin can be registered by using `use` method.
35
35
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.
37
37
38
38
## 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.
40
40
```ts
41
41
// plugin.ts
42
42
exportconst plugin =newElysia()
@@ -66,7 +66,7 @@ const app = new Elysia()
66
66
.listen(8080)
67
67
```
68
68
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.
70
70
71
71
## Config
72
72
You can customize plugin by creating function to return callback which accepts Elysia.
0 commit comments