| 1123 | * @since 2.0.0 |
| 1124 | */ |
| 1125 | export const passthrough = <Output, Input, Error, Env>( |
| 1126 | self: Schedule<Output, Input, Error, Env> |
| 1127 | ): Schedule<Input, Input, Error, Env> => |
| 1128 | fromStep(effect.map(toStep(self), (step) => (now, input) => |
| 1129 | Pull.matchEffect(step(now, input), { |
| 1130 | onSuccess: (result) => effect.succeed([input, result[1]]), |
| 1131 | onFailure: effect.failCause, |
| 1132 | onDone: () => Cause.done(input) |
| 1133 | }))) |
| 1134 | |
| 1135 | /** |
| 1136 | * Returns a `Schedule` which can only be stepped the specified number of |