import EventsManager from 'elementify/lib/events/eventsmanager.js'
EventsManager
EventsManager class provide an object in order to easily track and manage user-defined events Eventified Elements
See:
Constructor Summary
Public Constructor | ||
public |
|
version 1.0.0 since 1.0.0 |
Member Summary
Public Members | ||
public |
Events storage |
since 1.0.0 |
Method Summary
Public Methods | ||
public |
clean(): void Cleans events database from object that are not in DOM anymore. |
version 1.0.0 since 1.0.0 |
public |
Iterates on all events, specific event or specific event/callback
given the |
version 1.0.0 since 1.0.0 |
public |
Check if object have event, specific event or specific event/callback
given the |
version 1.0.0 since 1.0.0 |
public |
Fetch all events, specific event or specific event/callback
given the |
version 1.0.0 since 1.0.0 |
public |
Add and event/callback |
version 1.0.0 since 1.0.0 |
public |
Remove all events, specific event or specific event/callback
given the |
version 1.0.0 since 1.0.0 |
Public Constructors
public constructor(): EventsManager version 1.0.0 since 1.0.0 source
Public Members
Public Methods
public clean(): void version 1.0.0 since 1.0.0 source
Cleans events database from object that are not in DOM anymore. This method is called each time the events manager is accessed
Return:
void |
public forEach(cb: Function, pKey: string): boolean version 1.0.0 since 1.0.0 source
Iterates on all events, specific event or specific event/callback
given the pKey
paramater value
public has(key: string): boolean version 1.0.0 since 1.0.0 source
Check if object have event, specific event or specific event/callback
given the key
parameter value
Params:
Name | Type | Attribute | Description |
key | string |
|
All events if not provided or path to the event or event callback in dotted way |
public pull(key: string): boolean version 1.0.0 since 1.0.0 source
Fetch all events, specific event or specific event/callback
given the key
paramater value
Params:
Name | Type | Attribute | Description |
key | string |
|
All events if not provided or path to the event or event callback in dotted way |
public push(key: string, val: Function, pKey: string): this version 1.0.0 since 1.0.0 source
Add and event/callback
Return:
this | Chainable |