@lendi/lendi-app-bridge
v3.2.0
Published
Library to share state between micro frontends and lendi-app
Downloads
894
Maintainers
Keywords
Readme
lendi-app-bridge
A library to bridge data between micro frontends and @lendi/lendi-app using localStorage
Api
class LendiAppBridge(prefix?: string, storage? = window.localStorage: Storage): LendiAppBridge
Returns an instance of a lendiAppBridge.
Example:
import LendiAppBridge from '@lendi/lendi-app-bridge';
const bridge = new LendiAppBridge();
LendiAppBridge#getFunnelOneApiData(): FunnelOneApiData
Gets FunnelOneApiData from localStorage
Example:
import LendiAppBridge from '@lendi/lendi-app-bridge';
const bridge = new LendiAppBridge();
const funnelOneData = bridge.getFunnelOneApiData();
LendiAppBridge#updateFunnelOneApiData(newData: FunnelOneApiData): void
Updates FunnelOneApiData in localStorage
Example:
import LendiAppBridge from '@lendi/lendi-app-bridge';
const bridge = new LendiAppBridge();
const funnelOneData = bridge.getFunnelOneApiData();
const newFunnelOneData = { ...funnelOneData, security_value: 100 };
bridge.updateFunnelOneApiData(newFunnelOneData);
LendiAppBridge#clearFunnelOneData(): void
Clears any data for funnel-one in localStorage
Example:
import LendiAppBridge from '@lendi/lendi-app-bridge';
const bridge = new LendiAppBridge();
bridge.clearFunnelOneData();
LendiAppBridge#getActiveApplicationSfId(): ActiveApplicationSfId | undefined
Gets ActiveApplicationSfId from localStorage or returns undefined if doesnt exist
Example:
import LendiAppBridge from '@lendi/lendi-app-bridge';
const bridge = new LendiAppBridge();
const activeApplicationSfId = bridge.getActiveApplicationSfId();
LendiAppBridge#updateActiveApplicationSfId(newData: ActiveApplicationSfId): void
Updates ActiveApplicationSfId in localStorage
Example:
import LendiAppBridge from '@lendi/lendi-app-bridge';
const bridge = new LendiAppBridge();
bridge.updateActiveApplicationSfId('A-NEW-ID');