Dispatcher

Event/Command Dispatcher.

Constructor

new Dispatcher()

Methods

delegate(event, args) → {Promise.<(false|any)>}

Delegates runtime/component event to interceptors.

Parameters:
Name Type Description
event string

event name to be handled

args Array.<any>

arguments of the event

Returns:
Type:
Promise<(false|any)>

return a promise resolved by false if there is no interceptor responds. Resolved with anything truthy otherwise.

dispatchAppEvent(appId, event, params, optionsopt)

Dispatch an event to app. App would be created if app is not running.

Parameters:
Name Type Attributes Description
appId string
event string
params Array.<any>
options object <optional>
Name Type Attributes Default Description
preemptive boolean <optional>
true

if app is preemptive

form 'cut' | 'scene' <optional>
'cut'
skillId string <optional>

cloud skill stack would be updated to given skill id.

carrierId string <optional>

if app is brought to life by other app