UNPKG

@iore8655/react-bus

Version:

@iore8655/react-bus is a global/local state management by pub/sub

16 lines (15 loc) 546 B
import { Bus } from './react-bus-core'; declare class StateBus extends Bus { private initialState; private state; constructor(initialState: Object); private rerender; setState(props: Object): void; getState(): any; reset(props?: Object): void; restore(newState: Object): void; dispatch(props: Function | Object): void; } export declare function createStateBus(initialState: Object): StateBus; export declare function useStateBusSelector(stateBus: StateBus, selector?: Function): any; export {};