You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each of the following methods takes one or two arguments
43
45
44
46
- Subscribe
45
47
46
-
47
-
| Method name | Payload | Return value |
48
-
| ------ | ------ | ------ |
49
-
| subscribe |```pubSub.subscribe("eventName", (data) => {});```| HashKey (string) - is needed for use in the 'unsubscribe' method |
50
-
| unsubscribe |```pubSub.unsubscribe('hashKey')``` <br /> hashKey (string) is always returned from the subscribe method | true - when the event has been successfully unsubscribed <br /> false - when the event does not exists |
51
-
| publish |```pubSub.publish('eventName', any)``` <br /> any = literally anything you want to pass :) <br /> If you don't pass anything, the default value will be undefined | true - when the event has published successfully <br /> false - when the event has not been published (e.g. due to the lack of a registered subscriber) |
52
-
| getAllSubscribers | - | returns the current subscription list |
| subscribe |`pubSub.subscribe("eventName", (data) => {});`| HashKey (string) - is needed for use in the 'unsubscribe' method |
51
+
| unsubscribe |`pubSub.unsubscribe('hashKey')` <br /> hashKey (string) is always returned from the subscribe method | true - when the event has been successfully unsubscribed <br /> false - when the event does not exists |
52
+
| publish |`pubSub.publish('eventName', any)` <br /> any = literally anything you want to pass :) <br /> If you don't pass anything, the default value will be undefined | true - when the event has published successfully <br /> false - when the event has not been published (e.g. due to the lack of a registered subscriber) |
53
+
| getAllSubscribers | - | returns the current subscription list |
54
54
55
55
### Roadmap:
56
56
@@ -59,4 +59,3 @@ Each of the following methods takes one or two arguments
0 commit comments