Observer
12 Sep 20252 minutes to read
Methods
destroy
To destroy handlers in the event
Returns void
notify
To notify the handlers in the specified event.
| Parameter | Type | Description |
|---|---|---|
| property | string |
Specifies the event to be notify. |
| argument (optional) | Object |
Additional parameters to pass while calling the handler. |
| successHandler (optional) | Function |
this function will invoke after event successfully triggered |
| errorHandler (optional) | Function |
this function will invoke after event if it was failure to call. |
Returns void | Object
off
To remove handlers from a event attached using on() function.
| Parameter | Type | Description |
|---|---|---|
| property | string |
specifies the name of the event. |
| handler (optional) | Function |
Optional argument specifies the handler function to be called while event notified. |
| id (optional) | string |
specifies the random generated id. |
Returns void
offIntlEvents
To remove internationalization events
Returns void
on
To attach handler for given property in current context.
| Parameter | Type | Description |
|---|---|---|
| property | string |
specifies the name of the event. |
| handler | Function |
Specifies the handler function to be called while event notified. |
| context (optional) | Object |
Specifies the context binded to the handler. |
| id (optional) | string |
specifies the random generated id. |
Returns void