UNPKG

undux

Version:

Dead simple state management for React

19 lines (18 loc) 722 B
import * as React from 'react'; import { Effects, Store } from '..'; import { Diff } from '../utils'; export type ContainerProps<State extends object> = { children: React.ReactNode; effects?: Effects<State>; initialState?: State; }; export type CreateConnectedStore<State extends object> = { Container: React.ComponentType<ContainerProps<State>>; useStore(): Store<State>; withStore: <Props extends { store: Store<State>; }>(Component: React.ComponentType<Props>) => React.ComponentType<Diff<Props, { store: Store<State>; }>>; }; export declare function createConnectedStore<State extends object>(initialState: State, effects?: Effects<State>): CreateConnectedStore<State>;