ampache_react/app/utils/reducers.js

10 lines
253 B
JavaScript
Raw Normal View History

2016-07-07 23:23:18 +02:00
export function createReducer(initialState, reducerMap) {
return (state = initialState, action) => {
const reducer = reducerMap[action.type];
return reducer
? reducer(state, action.payload)
: state;
};
}