Skip to content

Commit

Permalink
feat: add redux-thunk as middleware
Browse files Browse the repository at this point in the history
Relates #43
  • Loading branch information
RamyAlshurafa committed Dec 31, 2018
1 parent a2e96dc commit f5ea1b1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions client/src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { createStore } from 'redux';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';

import appReducer from '../reducers';

const initialState = {};

const store = createStore(appReducer, initialState);
const middlewares = [thunk];

const store = createStore(
appReducer,
initialState,
applyMiddleware(...middlewares)
);

export default store;

0 comments on commit f5ea1b1

Please sign in to comment.