pivots
Version:
## Readable [discriminated unions](https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions) for TypeScript
13 lines (9 loc) • 358 B
JavaScript
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));
}
export { applyType };
//# sourceMappingURL=pivots.esm.js.map