@rtbjs/use-state
Version:
`@rtbjs/use-state` is a state management tool that can act as a local state and be easily turned into a global redux state. It is an innovative approach to state management that combines the advantages of both React's useState and Redux's state management
10 lines (9 loc) • 390 B
TypeScript
import { Provider } from 'react-redux';
declare function useStateTB<S>(props: {
initialValue?: S | (() => S);
forceInitialValue?: boolean;
name?: string;
logs?: boolean;
}): [S, (value: S) => void];
declare const monitorReducerEnhancer: (createStore: any) => (_reducer: any, initialState: any, enhancer: any) => any;
export { useStateTB, Provider, monitorReducerEnhancer };