Skip to content

Instantly share code, notes, and snippets.

@mcjcloud
Created July 10, 2020 06:46
Show Gist options
  • Save mcjcloud/b688e3612f21fd4d9b031a37ba065fad to your computer and use it in GitHub Desktop.
Save mcjcloud/b688e3612f21fd4d9b031a37ba065fad to your computer and use it in GitHub Desktop.
Asterisk Medium Article: redux
import { applyMiddleware, combineReducers, createStore } from "redux"
import thunk from "redux-thunk"
import todo, { TodoAction } from "./todo"
// Action Types
export type Action = TodoAction
const reducer = combineReducers({ todo })
export type State = ReturnType<typeof reducer>
// create the redux store
export default createStore<State, any, any, any>(reducer, {}, applyMiddleware(thunk))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment