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