Skip to content

Commit

Permalink
Merge pull request #53 from hoilzz/master
Browse files Browse the repository at this point in the history
add update type
  • Loading branch information
mweststrate authored Jul 16, 2020
2 parents e73e78a + 0e4686b commit 700b942
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export type Reducer<S = any, A = any> = (
action: A
) => void | S;

export type ImmerHook<S> = [S, (f: (draft: Draft<S>) => void | S) => void];
export type Update<S> = (f: (draft: Draft<S>) => void | S) => void;

export type ImmerHook<S> = [S, Update<S>];

export function useImmer<S = any>(
initialValue: S | (() => S)
Expand Down

0 comments on commit 700b942

Please sign in to comment.