Skip to content

Commit

Permalink
feat(types): add optimistic type to action
Browse files Browse the repository at this point in the history
  • Loading branch information
aboudicheng committed Nov 5, 2020
1 parent 70827d8 commit c7eade3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ export type Dispatch<A> = (value: A) => void;
export type Reducer<S, A> = (prevState: S, action: A) => S;
export type ReducerState<R extends Reducer<any, any>> = R extends Reducer<infer S, any> ? S : never;
export type ReducerAction<R extends Reducer<any, any>> = R extends Reducer<any, infer A>
? A
? A & { optimistic?: Optimistic }
: never;

0 comments on commit c7eade3

Please sign in to comment.