@vorthain/react-state
Version:
A minimal and reactive state management library for React, enabling automatic UI updates through direct, mutable state changes.
20 lines (19 loc) • 707 B
TypeScript
declare let StoreConstructor: any;
/**
* Create global store with type registration
*/
export declare function createVorthainStore<T extends object>(RootStoreClass: new () => T): T;
/**
* Hook to access global store
* Automatically integrates with vGrip when used inside a vGrip component
*/
export declare function useVglobal(): InstanceType<typeof StoreConstructor>;
/**
* Resets the Vorthain global store singleton.
* This function is intended for use in testing environments (e.g., Jest)
* to ensure that each test runs in isolation without state leaking from previous tests.
* Call this in a `beforeEach` block.
* @internal
*/
export declare function _resetVorthainStore(): void;
export {};