mirror of
https://github.com/yldio/copilot.git
synced 2024-11-14 15:20:06 +02:00
30 lines
679 B
JavaScript
30 lines
679 B
JavaScript
|
const takeRight = require('lodash.takeright');
|
||
|
const redux = require('redux');
|
||
|
const reduxFormReducer = require('redux-form').reducer;
|
||
|
|
||
|
const {
|
||
|
createStore,
|
||
|
compose,
|
||
|
combineReducers,
|
||
|
applyMiddleware
|
||
|
} = redux;
|
||
|
|
||
|
/*const reducer = (state, action) => {
|
||
|
if (action.type !== 'UPDATE_STATS') {
|
||
|
return state;
|
||
|
}
|
||
|
|
||
|
const data = (state.data || []).concat([action.payload]);
|
||
|
|
||
|
return {
|
||
|
...state,
|
||
|
data: takeRight(data, 50)
|
||
|
};
|
||
|
};*/
|
||
|
|
||
|
const reducer = combineReducers({ form: reduxFormReducer });
|
||
|
|
||
|
module.exports = (state = Object.freeze({})) => {
|
||
|
return createStore(reducer, state, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());
|
||
|
};
|