( self: Schedule.Schedule<Out, In, R> )
| 609 | |
| 610 | /** @internal */ |
| 611 | export const delays = <Out, In, R>( |
| 612 | self: Schedule.Schedule<Out, In, R> |
| 613 | ): Schedule.Schedule<Duration.Duration, In, R> => |
| 614 | makeWithState(self.initial, (now, input, state) => |
| 615 | pipe( |
| 616 | self.step(now, input, state), |
| 617 | core.flatMap(( |
| 618 | [state, _, decision] |
| 619 | ): Effect.Effect<[any, Duration.Duration, ScheduleDecision.ScheduleDecision]> => { |
| 620 | if (ScheduleDecision.isDone(decision)) { |
| 621 | return core.succeed([state, Duration.zero, decision]) |
| 622 | } |
| 623 | return core.succeed( |
| 624 | [ |
| 625 | state, |
| 626 | Duration.millis(Intervals.start(decision.intervals) - now), |
| 627 | decision |
| 628 | ] |
| 629 | ) |
| 630 | }) |
| 631 | )) |
| 632 | |
| 633 | /** @internal */ |
| 634 | export const mapBoth = dual< |
nothing calls this directly
no test coverage detected