@pushwoosh/session-store
v2.8.2
Published
Shared utility that fetches the current user session from `getAuthInfo` / `GetOnboardingInfo` RPC calls and exposes it as an observable `SessionStore` class with subscribe/update semantics. Other micro-frontends consume it through `spa-context.sessionStor
Readme
@pushwoosh/session-store
Shared utility that fetches the current user session from getAuthInfo / GetOnboardingInfo RPC calls and exposes it as an observable SessionStore class with subscribe/update semantics. Other micro-frontends consume it through spa-context.sessionStore.
Quick start
npm ci # install dependencies
npm run build # d.ts (tsc) + SystemJS bundle (frontend-builder-engine) -> dist/
npm run check # eslint + tsc --noEmitUsage
import { SessionStore } from '@pushwoosh/session-store';
const store = new SessionStore(rpcGateway);
await store.update();
const sub = store.subscribe((session) => { /* react to changes */ });
sub.unsubscribe();