Methods
(static) publish(params, params) → {Promise}
- Description:
Publish
Example
publish('myEvent', '1234', {my: 'data'});
Parameters:
Name | Type | Description |
---|---|---|
params |
string | Event Name |
params |
object | Payload |
Returns:
- Type
- Promise
(static) subscribe(channel, id, callback) → {EventEmitter}
- Description:
Subscribe
Example
subscribe('myEvent', '1234', (data) => {
console.log(data);
});
Parameters:
Name | Type | Description |
---|---|---|
channel |
string | Channel |
id |
string | ID |
callback |
callback | Callback Function |
Returns:
- Type
- EventEmitter