Home Reference Source
import {Emitter} from 'tablefilter/src/emitter.js'
public class | source

Emitter

Event emitter class

Constructor Summary

Public Constructor
public

Creates an instance of Emitter.

Member Summary

Public Members
public

Events object

Method Summary

Public Methods
public

emit(evt: String)

Emit an event

public

off(evts: Array, fn: Function)

Unsubscribe to an event

public

on(evts: Array, fn: Function)

Subscribe to an event

Public Constructors

public constructor() source

Creates an instance of Emitter.

Public Members

public events: Object source

Events object

Public Methods

public emit(evt: String) source

Emit an event

Params:

NameTypeAttributeDescription
evt String

Event name followed by any other argument passed to the invoked function

public off(evts: Array, fn: Function) source

Unsubscribe to an event

Params:

NameTypeAttributeDescription
evts Array

Collection of event names

fn Function

Function invoked when event is emitted

public on(evts: Array, fn: Function) source

Subscribe to an event

Params:

NameTypeAttributeDescription
evts Array

Collection of event names

fn Function

Function invoked when event is emitted