source: imaps-frontend/node_modules/react-use/esm/useMediatedState.d.ts

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 531 bytes
Line 
1import { Dispatch, SetStateAction } from 'react';
2export interface StateMediator<S = any> {
3 (newState: any): S;
4 (newState: any, dispatch: Dispatch<SetStateAction<S>>): void;
5}
6export declare type UseMediatedStateReturn<S = any> = [S, Dispatch<SetStateAction<S>>];
7export declare function useMediatedState<S = undefined>(mediator: StateMediator<S | undefined>): UseMediatedStateReturn<S | undefined>;
8export declare function useMediatedState<S = any>(mediator: StateMediator<S>, initialState: S): UseMediatedStateReturn<S>;
Note: See TracBrowser for help on using the repository browser.