UNPKG

substate

Version:

Pub/Sub pattern with State Management

26 lines 838 B
import type { TState } from '../../core/Substate/interfaces'; import type { ISubstate } from '../../core/Substate/Substate.interface'; import type { SubstateActions } from './types'; type State = TState; /** * React hook that returns all Substate store methods bound to the provided store * * @param store - The Substate store instance * @returns Object containing all bound store methods * * @example * const { * updateState, * resetState, * jumpToTag, * clearHistory, * sync * } = useSubstateActions(store); * * // Use the actions * updateState({ count: count + 1 }); * jumpToTag('checkpoint-1'); */ export declare function useSubstateActions<TSubstateState extends State = State>(store: ISubstate<TSubstateState>): SubstateActions<TSubstateState>; export {}; //# sourceMappingURL=useSubstateActions.d.ts.map