Skip to content

Commit

Permalink
Minor typing tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
pelotom committed Apr 16, 2019
1 parent ac730d6 commit 4472409
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ export type ActionByType<A, T> = A extends { type: infer T2 } ? (T extends T2 ?
export default function useMethods<S, R extends MethodRecordBase<S>>(
methods: Methods<S, R>,
initialState: S,
): StateAndCallbacksFor<typeof methods>;
): StateAndCallbacksFor<Methods<S, R>>;
export default function useMethods<S, R extends MethodRecordBase<S>, I>(
methods: Methods<S, R>,
initializerArg: I,
initializer: (arg: I) => S,
): StateAndCallbacksFor<typeof methods>;
): StateAndCallbacksFor<Methods<S, R>>;
export default function useMethods<S, R extends MethodRecordBase<S>>(
methods: Methods<S, R>,
initialState: any,
initializer?: any,
): StateAndCallbacksFor<typeof methods> {
): StateAndCallbacksFor<Methods<S, R>> {
const reducer = useMemo<Reducer<S, ActionUnion<R>>>(
() =>
(produce as any)((state: S, action: ActionUnion<R>) =>
Expand Down

0 comments on commit 4472409

Please sign in to comment.