pivots
Version:
## Readable [discriminated unions](https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions) for TypeScript
17 lines (11 loc) • 458 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
function applyType(receivers, action) {
var func = receivers[action.type];
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
return func.call.apply(func, [null, action].concat(args));
}
exports.applyType = applyType;
//# sourceMappingURL=pivots.cjs.development.js.map