scrivito
Version:
Scrivito is a professional, yet easy to use SaaS Enterprise Content Management Service, built for digital agencies and medium to large businesses. It is completely maintenance-free, cost-effective, and has unprecedented performance and security.
22 lines (16 loc) • 678 B
text/typescript
import { onReset } from 'scrivito_sdk/common';
import { StateContainer } from 'scrivito_sdk/state';
import { StateTree } from 'scrivito_sdk/state/state_tree';
import { resetSubscribers } from 'scrivito_sdk/state/subscribers';
// this type described the shape of the global state tree, i.e. what's stored inside it
export interface GlobalState {
// empty placeholder - this type is augmented by individual modules
}
const stateTree = new StateTree<GlobalState>();
export const globalState: StateContainer<GlobalState> = stateTree;
// for test purposes only
export function resetGlobalState(): void {
resetSubscribers();
stateTree.clear();
}
onReset(resetGlobalState);