@wordpress/core-data
Version:
Access to and manipulation of core WordPress entities.
21 lines (19 loc) • 624 B
JavaScript
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
;