Created
February 20, 2018 14:25
-
-
Save SuperOleg39/9100006a9485b1890830b47618846f58 to your computer and use it in GitHub Desktop.
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
| export enum constants { | |
| SET = 'feature/SET', | |
| } | |
| export type actions = { | |
| set: { | |
| type: constants.SET; | |
| }; | |
| } | |
| type RootAction = actions[keyof actions]; | |
| export const reducer = (state = initialState, action: RootAction): IState => { | |
| switch (action.type) { | |
| case constants.SET: | |
| return state; | |
| default: | |
| return state; | |
| } | |
| } | |
| export const actionCreators = { | |
| set: (): actions['set'] => ({ type: constants.SET }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment