# JsDoc Reference - jsPDF-PubSub

Class Index | File Index

## Classes

- _global_
- FontObject
- jsPDF
- jsPDF-PubSub

# Class jsPDF-PubSub

Defined in: jspdf.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
<inner> | jsPDF-PubSub(context) PubSub implementation

Field Summary
Field Attributes | Field Name and Description
--- | ---
| topics

Method Summary
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

Class Detail
<inner> jsPDF-PubSub(context)
PubSub implementation

Parameters:
context

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

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Aug 21 2012 12:58:07 GMT-0700 (PDT)