Skip to content

Commit

Permalink
fix: added awaits in Bun.connect calls
Browse files Browse the repository at this point in the history
  • Loading branch information
kunokareal committed Mar 22, 2024
1 parent 7111318 commit 056a153
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/api/tcp.md
Expand Up @@ -115,7 +115,7 @@ Use `Bun.connect` to connect to a TCP server. Specify the server to connect to w

```ts
// The client
const socket = Bun.connect({
const socket = await Bun.connect({
hostname: "localhost",
port: 8080,

Expand All @@ -138,7 +138,7 @@ To require TLS, specify `tls: true`.

```ts
// The client
const socket = Bun.connect({
const socket = await Bun.connect({
// ... config
tls: true,
});
Expand All @@ -164,7 +164,7 @@ server.reload({
```

```ts#Client
const socket = Bun.connect({ /* config */ })
const socket = await Bun.connect({ /* config */ })
socket.reload({
data(){
// new 'data' handler
Expand Down

0 comments on commit 056a153

Please sign in to comment.