Skip to content

Commit a7c004f

Browse files
authored
Merge pull request #27 from yaikohi/patch-2
style: fixed some grammar, rephrased sentences
2 parents 8e78c17 + 54e94e3 commit a7c004f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/patterns/websocket.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ head:
1515
---
1616

1717
# WebSocket
18-
Elysia WebSocket is extending Bun WebSocket which use [uWebSocket](https://github.com/uNetworking/uWebSockets) under the hood.
18+
Elysia WebSocket extends Bun's WebSocket which uses [uWebSocket](https://github.com/uNetworking/uWebSockets) under the hood.
1919

20-
To start using WebSocket, register the WebSocket plugin, and start declaring WebSocket route with `.ws`.
20+
To start working with a WebSocket, register the Elysia WebSocket plugin, and declare a WebSocket route with `.ws`.
2121
```typescript
2222
import { Elysia, ws } from 'elysia'
2323

@@ -31,14 +31,14 @@ new Elysia()
3131
.listen(8080)
3232
```
3333

34-
WebSocket route is extending Bun WebSocket configuration, for additional configuration please refers to [Bun's WebSocket](https://bun.sh/docs/api/websockets).
3534

36-
Just like normal route, WebSocket also accepts **schema** to strictly type and validate requests.
35+
Just like normal route, WebSockets also accepts a **schema** object to strictly type and validate requests.
3736

3837
## Configuration
39-
This plugin extends config from [Bun WebSocket](https://github.com/oven-sh/bun#websockets-with-bunserve)
4038

41-
Below is a config extends from [Bun WebSocket](https://github.com/oven-sh/bun#websockets-with-bunserve)
39+
Elysia's WebSocket plugin extends Bun's WebSocket configuration so if you wish to configure the websocket you can refer to [Bun's WebSocket documentation](https://bun.sh/docs/api/websockets) to learn more about this.
40+
41+
Below is a config that extends from [Bun WebSocket](https://github.com/oven-sh/bun#websockets-with-bunserve)
4242

4343
### perMessageDeflate
4444
@default `false`
@@ -65,11 +65,11 @@ The maximum number of bytes that can be buffered for a single connection.
6565

6666
Close the connection if the backpressure limit is reached.
6767

68-
## Method
69-
Below are the new methods register by the plugin
68+
## Methods
69+
Below are the new methods that are available to the WebSocket plugin
7070

7171
## ws
72-
Create websocket handler
72+
Create a websocket handler
7373

7474
Example:
7575
```typescript

0 commit comments

Comments
 (0)