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
We recommend to <u>**always use method chaining**</u> to provide an accurate type inference.
62
+
We recommend <u>**always using method chaining**</u> to provide an accurate type inference.
63
63
64
64
## Controller
65
65
> 1 Elysia instance = 1 controller
@@ -160,9 +160,9 @@ As Elysia type is complex, and heavily depends on plugin and multiple level of c
160
160
161
161
### ✅ Do: Request dependent service as Elysia instance
162
162
163
-
We recommended to abstract service class away from Elysia.
163
+
We recommend abstracting service classes away from Elysia.
164
164
165
-
However, **if the service is a request dependent service** or need to process HTTP request. We recommended to abstract it as Elysia instance to ensure type integrity and inference:
165
+
However, **if the service is a request dependent service** or needs to process HTTP requests, ee recommend abstracting it as an Elysia instance to ensure type integrity and inference:
In case of **absolute necessity**, you may infer the `Context` type from the Elysia instance itself:
200
+
If **absolutely necessary**, you may infer the `Context` type from the Elysia instance itself:
201
201
```typescript
202
202
import { Elysia, typeInferContext } from'elysia'
203
203
@@ -216,9 +216,9 @@ class AuthService {
216
216
}
217
217
```
218
218
219
-
However we recommend to avoid this if possible, and use[Elysia as a service](✅-do-use-elysia-instance-as-a-service) instead.
219
+
However, we recommend avoiding this if possible, and using[Elysia as a service](✅-do-use-elysia-instance-as-a-service) instead.
220
220
221
-
You may find more about [InferContext](/essential/handler#infercontext) in [Essential: Handler](/essential/handler).
221
+
You can learn more about [InferContext](/essential/handler#infercontext) in [Essential: Handler](/essential/handler).
222
222
223
223
## Model
224
224
Model or [DTO (Data Transfer Object)](https://en.wikipedia.org/wiki/Data_transfer_object) is handle by [Elysia.t (Validation)](/validation/overview.html#data-validation).
0 commit comments