This commit is contained in:
Lee Henson
2017-12-13 13:54:26 +00:00
parent 34db3d7070
commit ee7e7a4085
+1 -8
View File
@@ -134,20 +134,13 @@ declare module 'recompose' {
// withStateHandlers: https://github.com/acdlite/recompose/blob/master/docs/API.md#withstatehandlers
type StateHandler<TState> = (...payload: any[]) => TState | undefined;
type StateHandlerMap<TState> = {
[updaterName: string]: StateHandler<TState>;
};
type StateUpdaters<TOutter, TState, TUpdaters> = {
[updaterName in keyof TUpdaters]: (state: TState, props: TOutter) => StateHandler<TState>;
};
export function withStateHandlers<
TState,
TUpdaters extends StateHandlerMap<TState>,
TOutter extends {} = {}
>(
export function withStateHandlers<TState, TUpdaters extends StateHandlerMap<TState>, TOutter = {}>(
createProps: TState | mapper<TOutter, TState>,
stateUpdaters: StateUpdaters<TOutter, TState, TUpdaters>,
): InferableComponentEnhancerWithProps<TOutter & TState & TUpdaters, TOutter>;