UNPKG

state-synchronizers

Version:

Deterministically update state based on other state

6 lines (5 loc) 265 B
import { StateUpdater } from '../types'; /** * Wraps an existing function with a state updater */ export declare const withStateSynchronization: <S>(stateUpdater: StateUpdater<S>) => <F extends (...args: any[]) => S>(fn: F) => (...args: Parameters<F>) => S;