Skip to content

Commit

Permalink
Add better typing for setState
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Lindsey committed Aug 13, 2018
1 parent 7512c6a commit 62be218
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type BoundAction = () => void;

export interface Store<K> {
action(action: Action<K>): BoundAction;
setState(update: object, overwrite?: boolean, action?: Action<K>): void;
setState<U extends keyof K>(update: Pick<K, U>, overwrite?: boolean, action?: Action<K>): void;
subscribe(f: Listener<K>): Unsubscribe;
unsubscribe(f: Listener<K>): void;
getState(): K;
Expand Down

0 comments on commit 62be218

Please sign in to comment.