API

ee factory

ee function returns an emitter instance.

ee(): Emitter

on method

on is an instance method on the emitter instance which subscribes the the handler onto the specified event. Event name can be either a String or a Regular Expression. The third param can either be a Boolean flag for enabling async notification or a number(milleseconds) for delayed async notification or a function which is a custom scheduler which accepts a handler function and schedules it for execution when the event is emitted.

on(event: String|RegExp,handler: Function, async: Boolean|Number|Function): Emitter

off method

off is an instance method on the emitter instance which unsubscribes the the handler from the specified event. Event name can be either a String or a Regular Expression.

off(event: String|RegExp,handler: Function): Emitter

emit method

emit is an instance method on the emitter instance which raises an event and notifies all the subscribers and also you can pass varargs while raising a particular event.

emit(event: String,...values: Any): Emitter