(
step: Effect<
(options: InputMetadata<Input>) => Pull.Pull<[Output, Duration.Duration], ErrorX, Output, EnvX>,
Error,
Env
>
)
| 317 | * @since 4.0.0 |
| 318 | */ |
| 319 | export const fromStepWithMetadata = <Input, Output, EnvX, ErrorX, Error, Env>( |
| 320 | step: Effect< |
| 321 | (options: InputMetadata<Input>) => Pull.Pull<[Output, Duration.Duration], ErrorX, Output, EnvX>, |
| 322 | Error, |
| 323 | Env |
| 324 | > |
| 325 | ): Schedule<Output, Input, Error | Pull.ExcludeDone<ErrorX>, Env | EnvX> => |
| 326 | fromStep(effect.map(step, (f) => { |
| 327 | const meta = metadataFn() |
| 328 | return (now, input) => f(meta(now, input)) |
| 329 | })) |
| 330 | |
| 331 | /** |
| 332 | * Extracts the step function from a Schedule. |