Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config?): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
(data): void
Parameters
data: { backgroundName: string; }
backgroundName: string
Returns void
Optionalconfig: {}
Configuration data for the event subscription.
Returns Promise<boolean>
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
unsubscribe: (() => Promise<boolean>)
Removes an event subscription.
Returns
A Promise of a boolean indicating if there was an existing subscription to remove or not.
(): Promise<boolean>
Removes an event subscription.
Returns Promise<boolean>
A Promise of a boolean indicating if there was an existing subscription to remove or not.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config?): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config?): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config?): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config?): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Param: config
Configuration data for the event subscription.
Param: callback
A callback that will be invoked each time the event occurs.
Returns
A Promise of a boolean indicating if the subscription was added for the first time (true) or replaced (false).
(callback, config?): Promise<boolean>
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.
Parameters
callback: ((data) => void)
A callback that will be invoked each time the event occurs.
Adds or replaces an event subscription. Subsequent calls will replace the subscription config and callback instead of creating additional subscriptions.