UNPKG

higher-order-reducers

Version:

A library of simple everyday reducer utility functions

15 lines (13 loc) 375 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var linkIf = function linkIf(predicate) { if (typeof predicate !== 'function') { throw new Error('Supplied predicate to "linkIf" is not a function'); } return function (state, action, next) { return predicate(state, action) ? next(state) : state; }; }; exports.default = linkIf;