Skip to content

Commit a48410f

Browse files
authored
Merge pull request #46 from JacquesLeupin/fix/docs
docs:obj destructure in docs
2 parents b485b43 + c91bf85 commit a48410f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,11 @@ The easiest way to find out when a channel has been successfully subscribed to i
407407
```typescript
408408
const pusher = Pusher.getInstance();
409409
const channels = {};
410-
await pusher.init(
410+
await pusher.init({
411411
apiKey: API_KEY,
412412
cluster: API_CLUSTER,
413413
authEndPoint: "https://your-server.com/pusher/auth"
414-
);
414+
});
415415
const myChannel = await pusher.subscribe(
416416
channelName:'presence-my-channel',
417417
onSubscriptionSucceeded: (channelName, data) => {
@@ -453,16 +453,16 @@ These are bound to a specific channel. You can reuse event names in different pa
453453

454454
```typescript
455455
const pusher = Pusher.getInstance();
456-
await pusher.init(
456+
await pusher.init({
457457
apiKey: API_KEY,
458458
cluster: API_CLUSTER
459-
);
460-
const myChannel = await pusher.subscribe(
459+
});
460+
const myChannel = await pusher.subscribe({
461461
channelName: "my-channel",
462462
onEvent: (event) => {
463463
console.log(`Got channel event: ${event}`);
464464
}
465-
);
465+
});
466466
await pusher.connect();
467467
```
468468

@@ -472,16 +472,16 @@ You can attach behavior to these events regardless of the channel the event is b
472472

473473
```typescript
474474
const pusher = Pusher.getInstance();
475-
await pusher.init(
475+
await pusher.init({
476476
apiKey: API_KEY,
477477
cluster: API_CLUSTER,
478478
onEvent: (event) {
479479
console.log(`Got event: ${event}`);
480480
}
481-
);
482-
const myChannel = await pusher.subscribe(
481+
});
482+
const myChannel = await pusher.subscribe({
483483
channelName: "my-channel"
484-
);
484+
});
485485
```
486486
487487
### PusherEvent

0 commit comments

Comments
 (0)