UNPKG

@react-hookz/web

Version:

React hooks done right, for browser and SSR.

6 lines (5 loc) 550 B
import type { Dispatch } from 'react'; import type { InitialState, NextState } from '../util/resolve-hook-state.js'; export declare function useMediatedState<State = undefined>(): [State | undefined, Dispatch<NextState<State | undefined>>]; export declare function useMediatedState<State>(initialState: InitialState<State>): [State, Dispatch<NextState<State>>]; export declare function useMediatedState<State, RawState = State>(initialState: InitialState<State>, mediator?: (state: RawState) => State): [State, Dispatch<NextState<RawState, State>>];