Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
Fixing Typescript generic inconsistencies and "arrayMerger" parameter…
Browse files Browse the repository at this point in the history
…s types (#273)
  • Loading branch information
robertgr991 committed May 20, 2020
1 parent ecc2c37 commit 5092dfb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ interface Storage {
interface Options<State> {
key?: string;
paths?: string[];
reducer?: (state: any, paths: string[]) => object;
reducer?: (state: State, paths: string[]) => object;
subscriber?: (
store: Store<State>
) => (handler: (mutation: any, state: any) => void) => void;
) => (handler: (mutation: any, state: State) => void) => void;
storage?: Storage;
getState?: (key: string, storage: Storage) => any;
setState?: (key: string, state: Store<State>, storage: Storage) => void;
setState?: (key: string, state: any, storage: Storage) => void;
filter?: (mutation: MutationPayload) => boolean;
arrayMerger?: (state: any, saved: any) => any;
arrayMerger?: (state: any[], saved: any[]) => any;
rehydrated?: (store: Store<State>) => void;
fetchBeforeUse?: boolean;
overwrite?: boolean;
Expand Down Expand Up @@ -85,7 +85,7 @@ export default function <State>(
savedState = fetchSavedState();
}

return function (store) {
return function (store: Store<State>) {
if (!options.fetchBeforeUse) {
savedState = fetchSavedState();
}
Expand Down

0 comments on commit 5092dfb

Please sign in to comment.