UNPKG

530 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.createReducer = void 0;
4const persist_1 = require("./persist");
5const createReducer = (handlers) => (state, action) => {
6 if (action.type === persist_1.INITIALIZE_STATE_FROM_STORAGE) {
7 return { ...state, ...action.payload };
8 }
9 if (!handlers.hasOwnProperty(action.type)) {
10 return state;
11 }
12 return handlers[action.type](state, action);
13};
14exports.createReducer = createReducer;
15//# sourceMappingURL=reducer.js.map
\No newline at end of file