Skip to main content

event

Tool for storing, retrieving and triggering events based on the event type.

Submit feedback
github
import { event } from '@uhg-abyss/web/tools/event';

Overview

The event tool provides various functions for storing, retrieving, adding listeners to the window storage and also triggers custom events to track the analytics of the application.

Triggering event

The event function provided by the tool accepts eventId and data as parameters and performs the required action based on the event id passed which are defined in the events of listeners and gives the update data.

event('HOME_PAGE_LOAD', { message: 'page loaded successfully' });

Get data

The event tool provides getData function to get the data from window storage.

event.getData();

Set data

The event tool provides setData function to set the data in window storage.

event.setData({ message: 'set data' });
Table of Contents