Skip to content

Commit 7857403

Browse files
committed
📘 feat: 0.4
2 parents ac0e2d5 + 4613273 commit 7857403

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

docs/concept/handler.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ app.get('/id/:id', (context) => context.params.id)
3333
3434
## Context
3535
Context's properties consists of
36-
- request: Raw `Request` for accessing data as web standard type
37-
- body: Body which come with the request
38-
- query: Parsed path query as a simple object
39-
- params: Path parameters as a simple object
40-
- store: A global mutable store for Elysia instance
41-
- set: Response representation
42-
- status: response status
43-
- headers: response headers
44-
- redirect: redirect to new path
36+
- `request`: Raw `Request` for accessing data as web standard type
37+
- `body`: Body which come with the request
38+
- `query`: Parsed path query as a simple object
39+
- `params`: Path parameters as a simple object
40+
- `store`: A global mutable store for Elysia instance
41+
- `set`: Response representation
42+
- `status`: response status
43+
- `headers`: response headers
44+
- `redirect`: redirect to new path
4545
4646
And a few helper methods for convenient usage:
47-
status: Function to set HTTP response status code
48-
redirect: Function to redirect to different path
49-
setHeader: Syntax sugar for setting specific header value
47+
- `status`: Function to set HTTP response status code
48+
- `redirect`: Function to redirect to different path
49+
- `setHeader`: Syntax sugar for setting specific header value
5050
5151
For both context, you can easily access in `Handler` function:
5252
```typescript

docs/concept/state-decorate.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@ head:
1515
---
1616

1717
# State and Decorate
18-
You can extend Elysia to fits your need.
19-
20-
This is useful when you to access extra values in a handler like a Database connection.
18+
You can extend Elysia to fit your need. This is useful when you need to access extra values in a handler (e.g. a database connection).
2119

2220
In summary:
23-
- state: assign value to `Context.store`
24-
- decorate: assign value to `Context`
21+
- `state`: assign value to `Context.store` (a global state object of the Elysia instance)
22+
- `decorate`: assign value to `Context`
2523

2624
::: tip
27-
`Context` is a parameter in callback of handler
25+
`Context` is a parameter in the callback of handler.
2826
:::
2927

3028
### Example

0 commit comments

Comments
 (0)