export const currentSession = Rx.make(
Option.none<CurrentUserAndSessionIdsSchema>(),
).pipe(
Rx.keepAlive,
);
export const saveStateToStorage = (registry: Registry.Registry) => {
const dehydratedState = Hydration.dehydrate(registry);
localStorage.setItem('app-state', JSON.stringify(dehydratedState));
};
export const getStoredState = (): Array<Hydration.DehydratedRx> => {
const stored = localStorage.getItem('app-state');
return stored != null ? JSON.parse(stored) : [];
};
export const currentSession = Rx.make(
Option.none<CurrentUserAndSessionIdsSchema>(),
).pipe(
Rx.keepAlive,
);
export const saveStateToStorage = (registry: Registry.Registry) => {
const dehydratedState = Hydration.dehydrate(registry);
localStorage.setItem('app-state', JSON.stringify(dehydratedState));
};
export const getStoredState = (): Array<Hydration.DehydratedRx> => {
const stored = localStorage.getItem('app-state');
return stored != null ? JSON.parse(stored) : [];
};