UNPKG

redux-and-the-rest

Version:

Declarative, flexible Redux integration with your RESTful API

21 lines (17 loc) 501 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; function applyReducers(reducersDictionary, resource) { var action = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var type = action.type; var actionReducer = reducersDictionary[type]; if (actionReducer) { return actionReducer.reducer(resource, action); } else { return resource; } } var _default = applyReducers; exports["default"] = _default;