ish.emitter()
Description:
A basic emitter factory.
Returns
emitter
An instance of the $.emitter
Methods
emit(type, argsObject)
Description:
Emit an action or data to subcribers.
Returns
$.emitter
Chainable.
Parameters:
| Name | Type | Description |
|---|---|---|
| type |
|
The name of the emission. |
| argsObject |
|
An Object of data to be passed with the emission. |
flush()
Description:
Remove all subscribers from the emitter instance.
Returns
$.emitter
Chainable.
subscribe(type, fn)
Description:
Subcribe from an a specific emission.
Returns
$.emitter
Chainable.
Parameters:
| Name | Type | Description |
|---|---|---|
| type |
|
The name of the emission type you are subscribing. |
| fn |
|
The function that you are subscribing. |
unsubscribe(type, fn)
Description:
Unsubcribe from an a specific emission.
Returns
$.emitter
Chainable.
Parameters:
| Name | Type | Description |
|---|---|---|
| type |
|
The name of the emission type you are unsubscribing. |
| fn |
|
The function that you are unsubscribing. |