EventHandler class
Constructors
Event |
Methods
add |
Adds event callbacks to array |
disable |
Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window |
emit |
Emits events by calling callback with event message |
enable |
Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window |
remove |
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
- callback
- EventCallbackFunction
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