@absolunet/ioc2.1.0

View on GitHub

Driver

Abstract driver that defines the basic interface for an event dispatcher driver.

Extends

Members

engine :*

Source:
Inherited From:
Current engine accessor.

Methods

(abstract) on(event, listener)

Source:
Add event listener.
Parameters:
Name Type Description
event string The event to listen.
listener function The listener.
Returns:
The current driver instance.
Type
events.services.Dispatcher.drivers.Driver

(abstract) off(event, listener)

Source:
Remove event listener for single listener.
Parameters:
Name Type Description
event string The event that has been listen.
listener function The listener.
Returns:
The current driver instance.
Type
events.services.Dispatcher.drivers.Driver

(abstract) once(event, listener)

Source:
Add event listener for first event dispatch only.
Parameters:
Name Type Description
event string The event to listen.
listener function The listener.
Returns:
The current driver instance.
Type
events.services.Dispatcher.drivers.Driver

(abstract) emit(event, payloadopt)

Source:
Dispatch an event with a given payload.
Parameters:
Name Type Attributes Description
event string The event to dispatch.
payload * <optional>
The payload to send into the listeners.
Returns:
The current driver instance.
Type
events.services.Dispatcher.drivers.Driver

(abstract) removeListeners(event)

Source:
Remove listeners for a given event.
Parameters:
Name Type Description
event string The event that has been listen.
Returns:
The current driver instance.
Type
events.services.Dispatcher.drivers.Driver

(abstract) removeAllListeners()

Source:
Remove all listeners for all events.
Returns:
The current driver instance.
Type
events.services.Dispatcher.drivers.Driver

setEngine(engine)

Source:
Inherited From:
Set current engine.
Parameters:
Name Type Description
engine * The engine instance.
Returns:
The current instance.
Type
support.mixins.HasEngine