Skip to content

Commit

Permalink
fix(resolveHookState): by accident removed needed type.
Browse files Browse the repository at this point in the history
  • Loading branch information
xobotyi committed Nov 6, 2019
1 parent 1840b57 commit 59aa41c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util/resolveHookState.ts
Expand Up @@ -5,10 +5,10 @@ export type InitialHookState<S> = S | InitialStateSetter<S>;
export type HookState<S> = S | StateSetter<S>;
export type ResolvableHookState<S> = S | StateSetter<S> | InitialStateSetter<S>;

export function resolveHookState<S>(newState: InitialStateSetter<S>): S;
export function resolveHookState<S>(newState: StateSetter<S>, currentState: S): S;
export function resolveHookState<S>(newState: ResolvableHookState<S>, currentState?: S): S;
export function resolveHookState<S>(newState: ResolvableHookState<S>, currentState?: S): S {
export function resolveHookState<S, C extends S>(newState: InitialStateSetter<S>): S;
export function resolveHookState<S, C extends S>(newState: StateSetter<S>, currentState: C): S;
export function resolveHookState<S, C extends S>(newState: ResolvableHookState<S>, currentState?: C): S;
export function resolveHookState<S, C extends S>(newState: ResolvableHookState<S>, currentState?: C): S {
if (typeof newState === 'function') {
return (newState as Function)(currentState);
}
Expand Down

0 comments on commit 59aa41c

Please sign in to comment.