UNPKG

@wordpress/core-data

Version:
21 lines (19 loc) 624 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; /** @typedef {import('../types').AnyFunction} AnyFunction */ /** * Higher-order reducer creator which substitutes the action object before * passing to the original reducer. * * @param {AnyFunction} replacer Function mapping original action to replacement. * * @return {AnyFunction} Higher-order reducer. */ const replaceAction = replacer => reducer => (state, action) => { return reducer(state, replacer(action)); }; var _default = exports.default = replaceAction; //# sourceMappingURL=replace-action.js.map