Class jsPDF-PubSub
Defined in: jspdf.js.
Constructor Attributes | Constructor Name and Description |
---|---|
<inner> |
jsPDF-PubSub(context)
PubSub implementation
|
Field Attributes | Field Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
publish(topic, **arguments, arg2, etc)
Allows caller to emit an event and pass arguments to event listeners.
|
|
subscribe(topic, callback, once)
Allows listener code to subscribe to channel and be called when data is available
|
|
unsubscribe(token)
Allows listener code to unsubscribe from a channel
|
Field Detail
topics
Method Detail
publish(topic, **arguments, arg2, etc)
Allows caller to emit an event and pass arguments to event listeners.
- Parameters:
- topic
- {String} Name of the channel on which to voice this event
- **arguments
- Any number of arguments you want to pass to the listeners of this event.
- arg2
- etc
{Object}
subscribe(topic, callback, once)
Allows listener code to subscribe to channel and be called when data is available
- Parameters:
- topic
- {String} Name of the channel on which to voice this event
- callback
- {Function} Executable (function pointer) that will be ran when event is voiced on this channel.
- once
- {Boolean} (optional. False by default) Flag indicating if the function is to be triggered only once.
- Returns:
- {Object} A token object that cen be used for unsubscribing.
unsubscribe(token)
Allows listener code to unsubscribe from a channel
- Parameters:
- token
- {Object} A token object that was returned by `subscribe` method