, i want to produce an error when the option is none and otherwise unwrap the some value. I will deal with the error later on. I came to this solution after a bit of playing around, is this a reasonable way of doing this?
const user = yield* _( userService.getUserByUsernameOrEmail(tenantId, usernameOrEmail), Effect.flatMap(Effect.orElseFail(() => new UserNotFoundError())),);
const user = yield* _( userService.getUserByUsernameOrEmail(tenantId, usernameOrEmail), Effect.flatMap(Effect.orElseFail(() => new UserNotFoundError())),);