EventManager

new EventManager()

EventManager

Methods

addEventType(type)

Add event type when given event not exists

Parameters:
Name Type Description
type string

Event type name

emit(eventName) → {Array}

Emit event

Parameters:
Name Type Description
eventName string

Event name to emit

Returns:
Array

emitReduce(eventName, sourceText) → {string}

Emit given event and return result

Parameters:
Name Type Description
eventName string

Event name to emit

sourceText string

Source text to change

Returns:
string

listen(typeStr, handler)

Listen event and bind event handler

Parameters:
Name Type Description
typeStr string

Event type string

handler function

Event handler

removeEventHandler(typeStr)

Remove event handler from given event type

Parameters:
Name Type Description
typeStr string

Event type name