Manual Reference Source Test
import EventsManager from 'elementify/lib/events/eventsmanager.js'
public class | version 1.0.0 | since 1.0.0 | source

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 pKey paramater value

version 1.0.0 since 1.0.0
public

has(key: string): boolean

Check if object have event, specific event or specific event/callback given the key parameter value

version 1.0.0 since 1.0.0
public

Fetch all events, specific event or specific event/callback given the key paramater value

version 1.0.0 since 1.0.0
public

push(key: string, val: Function, pKey: string): this

Add and event/callback

version 1.0.0 since 1.0.0
public

Remove all events, specific event or specific event/callback given the key paramater value

version 1.0.0 since 1.0.0

Public Constructors

public constructor(): EventsManager version 1.0.0 since 1.0.0 source

Return:

EventsManager

Event manager

Public Members

public orm: ObjectArray since 1.0.0 source

Events storage

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

Params:

NameTypeAttributeDescription
cb Function

Callback for iteration

pKey string
  • optional

Context parent key

Return:

boolean

true if result found

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:

NameTypeAttributeDescription
key string
  • optional

All events if not provided or path to the event or event callback in dotted way

Return:

boolean

true if result found

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:

NameTypeAttributeDescription
key string
  • optional

All events if not provided or path to the event or event callback in dotted way

Return:

boolean

true if result found

public push(key: string, val: Function, pKey: string): this version 1.0.0 since 1.0.0 source

Add and event/callback

Params:

NameTypeAttributeDescription
key string

Event name

val Function

Event callback

pKey string

Context parent key (useless)

Return:

this

Chainable

public remove(key: string): boolean version 1.0.0 since 1.0.0 source

Remove all events, specific event or specific event/callback given the key paramater value

Params:

NameTypeAttributeDescription
key string
  • optional

All events if not provided or path to the event or event callback in dotted way

Return:

boolean

true if result found