Class: Subject

Picasso.core. Subject

new Subject()

The subject constructor See the observer design pattern
Source:

Members

<inner> handlers :Object.<string, Array.<Picasso.pjo.EventHandler>>

All the event handlers (Observers) are stored here
Type:
Source:

Methods

<protected> _subscribe(eventType, callback, context)

Subscribes a new observer
Parameters:
Name Type Description
eventType string
callback function
context Object
Source:
Throws:
Picasso.error.InvalidParameters

<protected> _unsubscribe(eventType, callback, context)

Removes a observer of a event. If, only the eventType is given, removes all observers of this event type. If callback is given, removes all observers that calls this callback. And finnaly, if context is given too, removes if match the eventType, callback and context.
Parameters:
Name Type Description
eventType string
callback function
context Object
Source:
Throws:

fire(eventType, eventData, context)

Fires a event, calling all the observers of this event
Parameters:
Name Type Description
eventType string
eventData *
context Object
Source:
Throws: