UNPKG

@typed/effects

Version:

Generator-powered Effect management

14 lines 454 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.orFail = void 0; const either_1 = require("@typed/either"); const fail_1 = require("./fail"); function* orFail(key, effect) { const either = yield* effect; if (either_1.isRight(either)) { return either_1.fromRight(either); } return yield* fail_1.fail(key, either_1.fromLeft(either)); } exports.orFail = orFail; //# sourceMappingURL=orFail.js.map