Skip to content

Instantly share code, notes, and snippets.

@flushentitypacket
Created January 20, 2018 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushentitypacket/57ca081c0dca13c4b7145a972176c10d to your computer and use it in GitHub Desktop.
Save flushentitypacket/57ca081c0dca13c4b7145a972176c10d to your computer and use it in GitHub Desktop.
Typescript Redux combine features in index
// store/todo/index.ts
import {combineReducers} from 'redux'
import {
State as TodoState,
reducer as todoReducer,
actions as todoActions,
} from './todo'
import {
State as RewardState,
reducer as rewardReducer,
actions as rewardActions,
} from './reward'
export interface State {
todos: TodoState
rewards: RewardState
}
export const reducer = combineReducers<State>({
todos: todoReducer,
rewards: rewardReducer,
})
export const actions = {
...todoActions,
...rewardActions,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment