@typed/effects
Version:
Generator-powered Effect management
10 lines • 316 B
JavaScript
import { fromLeft, fromRight, isRight } from '@typed/either';
import { fail } from './fail';
export function* orFail(key, effect) {
const either = yield* effect;
if (isRight(either)) {
return fromRight(either);
}
return yield* fail(key, fromLeft(either));
}
//# sourceMappingURL=orFail.js.map