UNPKG

@darwish/hooks-core

Version:

6 lines (5 loc) 281 B
import { Draft } from 'immer'; export type DraftFunction<S> = (draft: Draft<S>) => void; export type Updater<S> = (arg: S | DraftFunction<S>) => void; export type ImmerHook<S> = [S, Updater<S>]; export default function useImmer<S = any>(initialValue: S | (() => S)): ImmerHook<S>;