EventHandler class

Constructors

EventHandler(Logger, ICrypto)

Methods

addEventCallback(EventCallbackFunction)

Adds event callbacks to array

disableAccountStorageEvents()

Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window

emitEvent(EventType, InteractionType, EventPayload, EventError)

Emits events by calling callback with event message

enableAccountStorageEvents()

Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window

removeEventCallback(string)

Removes callback with provided id from callback array

Constructor Details

EventHandler(Logger, ICrypto)

new EventHandler(logger: Logger, browserCrypto: ICrypto)

Parameters

logger

Logger

browserCrypto

ICrypto

Method Details

addEventCallback(EventCallbackFunction)

Adds event callbacks to array

function addEventCallback(callback: EventCallbackFunction): string | null

Parameters

Returns

string | null

disableAccountStorageEvents()

Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window

function disableAccountStorageEvents()

emitEvent(EventType, InteractionType, EventPayload, EventError)

Emits events by calling callback with event message

function emitEvent(eventType: EventType, interactionType?: InteractionType, payload?: EventPayload, error?: EventError)

Parameters

eventType
EventType
interactionType
InteractionType
payload
EventPayload
error
EventError

enableAccountStorageEvents()

Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window

function enableAccountStorageEvents()

removeEventCallback(string)

Removes callback with provided id from callback array

function removeEventCallback(callbackId: string)

Parameters

callbackId

string