use-sharable-state
Version:
This packages makes sharing states simpler
24 lines (23 loc) • 706 B
TypeScript
declare const store: {
addSetter: ({ stateKey, setterKey, setter, initialValue, }: {
stateKey: string;
setterKey: string;
setter: (state: any) => void;
initialValue?: any;
}) => void;
removeSetter: ({ stateKey, setterKey, }: {
stateKey: string;
setterKey: string;
}) => void;
updateState: ({ stateKey, value, }: {
stateKey: string;
value: any;
}) => void;
getCurrentState: (stateKey: string) => any;
getCurrentSetter: ({ stateKey, setterKey, }: {
stateKey: string;
setterKey: string;
}) => (state: any) => void;
generateId: () => string;
};
export default store;