File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -407,11 +407,11 @@ The easiest way to find out when a channel has been successfully subscribed to i
407
407
``` typescript
408
408
const pusher = Pusher .getInstance ();
409
409
const channels = {};
410
- await pusher .init (
410
+ await pusher .init ({
411
411
apiKey: API_KEY ,
412
412
cluster: API_CLUSTER ,
413
413
authEndPoint: " https://your-server.com/pusher/auth"
414
- );
414
+ } );
415
415
const myChannel = await pusher .subscribe (
416
416
channelName :' presence-my-channel' ,
417
417
onSubscriptionSucceeded : (channelName , data ) => {
@@ -453,16 +453,16 @@ These are bound to a specific channel. You can reuse event names in different pa
453
453
454
454
``` typescript
455
455
const pusher = Pusher .getInstance ();
456
- await pusher .init (
456
+ await pusher .init ({
457
457
apiKey: API_KEY ,
458
458
cluster: API_CLUSTER
459
- );
460
- const myChannel = await pusher .subscribe (
459
+ } );
460
+ const myChannel = await pusher .subscribe ({
461
461
channelName: " my-channel" ,
462
462
onEvent : (event ) => {
463
463
console .log (` Got channel event: ${event } ` );
464
464
}
465
- );
465
+ } );
466
466
await pusher .connect ();
467
467
```
468
468
@@ -472,16 +472,16 @@ You can attach behavior to these events regardless of the channel the event is b
472
472
473
473
``` typescript
474
474
const pusher = Pusher .getInstance ();
475
- await pusher .init (
475
+ await pusher .init ({
476
476
apiKey: API_KEY ,
477
477
cluster: API_CLUSTER ,
478
478
onEvent: (event ) {
479
479
console.log(` Got event: ${event } ` );
480
480
}
481
- );
482
- const myChannel = await pusher.subscribe(
481
+ } );
482
+ const myChannel = await pusher.subscribe({
483
483
channelName: " my-channel"
484
- );
484
+ } );
485
485
` ` `
486
486
487
487
### PusherEvent
You can’t perform that action at this time.
0 commit comments