From b4f8516d5cfde541c1f07278b166e4a2873fd680 Mon Sep 17 00:00:00 2001 From: nifanic Date: Sun, 16 Feb 2020 20:08:02 -0500 Subject: [PATCH 1/2] Ignore `.idea/` config files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b2ff859..2597dd9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ es lib .DS_Store *.log +.idea/ From b265270139b07f5c62cc0ecc2889f1ffdc9bd8c0 Mon Sep 17 00:00:00 2001 From: nifanic Date: Sun, 16 Feb 2020 20:11:58 -0500 Subject: [PATCH 2/2] Generalize Action type Fix #33. --- index.d.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/index.d.ts b/index.d.ts index f29eb8c..a3a585a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,13 +1,14 @@ -type Action = { - type: string; +type Action = { + type: T; }; -type Reducer = (state: S, action: Action) => S; +type Reducer = (state: S, action: A) => S; -export default function reduceReducers( - initialState: S | null, - ...reducers: Reducer[] -): Reducer; -export default function reduceReducers( - ...reducers: Reducer[] -): Reducer; +export default function reduceReducers( + initialState?: S, + ...reducers: Reducer[] +): Reducer; + +export default function reduceReducers( + ...reducers: Reducer[] +): Reducer;