UNPKG

react-mirrorstate

Version:

React library for bidirectional state synchronization with MirrorState

5 lines (4 loc) 307 B
import { Draft } from "immer"; export declare function useMirrorState<T>(name: string): [T | undefined, (updater: (draft: Draft<T>) => void) => void]; export declare function useMirrorState<T>(name: string, initialValue: T): [T, (updater: (draft: Draft<T>) => void) => void]; export default useMirrorState;