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 | |
---|
1 | import { Dispatch, SetStateAction } from 'react';
|
---|
2 | export interface StateMediator<S = any> {
|
---|
3 | (newState: any): S;
|
---|
4 | (newState: any, dispatch: Dispatch<SetStateAction<S>>): void;
|
---|
5 | }
|
---|
6 | export declare type UseMediatedStateReturn<S = any> = [S, Dispatch<SetStateAction<S>>];
|
---|
7 | export declare function useMediatedState<S = undefined>(mediator: StateMediator<S | undefined>): UseMediatedStateReturn<S | undefined>;
|
---|
8 | export declare function useMediatedState<S = any>(mediator: StateMediator<S>, initialState: S): UseMediatedStateReturn<S>;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.