( durationInput: Duration.DurationInput )
| 667 | |
| 668 | /** @internal */ |
| 669 | export const duration = ( |
| 670 | durationInput: Duration.DurationInput |
| 671 | ): Schedule.Schedule<Duration.Duration> => { |
| 672 | const duration = Duration.decode(durationInput) |
| 673 | const durationMillis = Duration.toMillis(duration) |
| 674 | return makeWithState(true as boolean, (now, _, state) => |
| 675 | core.succeed( |
| 676 | state |
| 677 | ? [ |
| 678 | false, |
| 679 | duration, |
| 680 | ScheduleDecision.continueWith(Interval.after(now + durationMillis)) |
| 681 | ] as const |
| 682 | : [false, Duration.zero, ScheduleDecision.done] as const |
| 683 | )) |
| 684 | } |
| 685 | |
| 686 | /** @internal */ |
| 687 | export const either = dual< |
no test coverage detected
searching dependent graphs…