Home Reference Source
public class | source

Emitter

The Emitter is a simple emitter class that provides you with on(), off() and trigger() methods

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

callbacks: {}

Method Summary

Public Methods
public

off(type: String, callback: Function): *

Unregisters callbacks by event name

public

on(type: String, callbacks: ...Function): *

Registers callbacks by event name

public

trigger(event: AbstractEvent): *

Triggers event callbacks by event object

Public Constructors

public constructor() source

Public Members

public callbacks: {} source

Public Methods

public off(type: String, callback: Function): * source

Unregisters callbacks by event name

Params:

NameTypeAttributeDescription
type String
callback Function

Return:

*

public on(type: String, callbacks: ...Function): * source

Registers callbacks by event name

Params:

NameTypeAttributeDescription
type String
callbacks ...Function

Return:

*

public trigger(event: AbstractEvent): * source

Triggers event callbacks by event object

Params:

NameTypeAttributeDescription
event AbstractEvent

Return:

*