(
step: Effect<
(options: InputMetadata<Input>) => Pull.Pull<[Output, Duration.Duration], ErrorX, Output, EnvX>,
Error,
Env
>
)
| 304 | * @since 4.0.0 |
| 305 | */ |
| 306 | export const fromStepWithMetadata = <Input, Output, EnvX, ErrorX, Error, Env>( |
| 307 | step: Effect< |
| 308 | (options: InputMetadata<Input>) => Pull.Pull<[Output, Duration.Duration], ErrorX, Output, EnvX>, |
| 309 | Error, |
| 310 | Env |
| 311 | > |
| 312 | ): Schedule<Output, Input, Error | Pull.ExcludeDone<ErrorX>, Env | EnvX> => |
| 313 | fromStep(effect.map(step, (f) => { |
| 314 | const meta = metadataFn() |
| 315 | return (now, input) => f(meta(now, input)) |
| 316 | })) |
| 317 | |
| 318 | /** |
| 319 | * Extracts the step function from a Schedule. |