Observer
Provides functionality for allowing an object to notify other objects when its state changes.
Methods
destroy
Destroys all event handlers.
Returns: Void
notify
Notify the handler that an event was raised.
Parameter | Type | Description |
---|---|---|
name | String | Specifies the property name. |
argument | Object | Specifies additional parameters to pass to the calling handler. |
success | Function | Specifies a callback function to be called when an event successfully is called. |
Returns: Void
off
Remove a handler for the given property that was previously attached.
Parameter | Type | Description |
---|---|---|
name | String | Specifies the property name. |
handler | Function | Specifies the handler function to be called when the event is notified. |
id | String | Specifies an id. |
Returns: Void
on
Attach a handler for the given property with the current context.
Parameter | Type | Description |
---|---|---|
name | String | Specifies the property name. |
handler | Function | Specifies the handler function to be called when the event is notified. |
context | Object | Specifies the context for the handler. |
id | String | Specifies an id. |
Returns: Void