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.
21 lines (15 loc) • 471 B
text/typescript
import { StateContainer } from 'scrivito_sdk/state';
import { globalState } from 'scrivito_sdk/state/global_state';
declare module 'scrivito_sdk/state/global_state' {
interface GlobalState {
dynamic: {
[id: string]: unknown;
};
}
}
let counter = 0;
export function createStateContainer<T>(): StateContainer<T> {
counter++;
const newState = globalState.subState('dynamic').subState(counter.toString());
return newState as StateContainer<T>;
}