Created
April 3, 2018 03:37
-
-
Save ddoronin/8f940639ff15f7589777cf06ad8cc055 to your computer and use it in GitHub Desktop.
TypeScript Redux Reducer Store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Reducer } from 'redux'; | |
export type ReducerState<S> = { | |
[P in keyof S]: Reducer<S[P]> | |
}; | |
/* Example | |
interface IState { | |
files: string[] | |
} | |
ReducerState<IState> will be | |
interface IState { | |
files: Reducer<string[]> | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment