Skip to content

Commit 0e9f069

Browse files
committed
chore: implement store and reducer file
1 parent 666a708 commit 0e9f069

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/reducers/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { combineReducers } from 'redux';
2+
3+
const rootReducer = combineReducers({
4+
state: () => ({})
5+
});
6+
7+
export default rootReducer;

src/store.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { createStore, applyMiddleware, compose } from 'redux';
2+
import thunk from 'redux-thunk';
3+
import logger from 'redux-logger';
4+
5+
import rootReducer from './reducers';
6+
7+
const middleware = applyMiddleware(thunk, logger);
8+
9+
const reduxDevTools =
10+
window.__REDUX_DEVTOOLS_EXTENSION__ &&
11+
window.__REDUX_DEVTOOLS_EXTENSION__();
12+
13+
const store = createStore(
14+
rootReducer,
15+
compose(
16+
middleware,
17+
reduxDevTools
18+
)
19+
);
20+
21+
export default store;

0 commit comments

Comments
 (0)