UNPKG

react-use-object-state

Version:

React hooks to create stateful API's for reusable object patterns

27 lines (26 loc) 894 B
import { CounterState } from "./types"; export declare const incrementBy: (val: number) => (state: CounterState) => { count: number; min?: number | undefined; max?: number | undefined; }; export declare const decrementBy: (val: number) => (state: CounterState) => { count: number; min?: number | undefined; max?: number | undefined; }; export declare const setCount: (count: CounterState['count']) => (state: CounterState) => { count: number; min?: number | undefined; max?: number | undefined; }; export declare const setMin: (min: CounterState['min']) => (state: CounterState) => { min: number | undefined; count: number; max?: number | undefined; }; export declare const setMax: (max: CounterState['max']) => (state: CounterState) => { max: number | undefined; count: number; min?: number | undefined; };