| 880 | * @since 2.0.0 |
| 881 | */ |
| 882 | export const fibonacci = (one: Duration.Input): Schedule<Duration.Duration> => { |
| 883 | const oneMillis = Duration.toMillis(Duration.fromInputUnsafe(one)) |
| 884 | return fromStep(effect.sync(() => { |
| 885 | let a = 0 |
| 886 | let b = oneMillis |
| 887 | return constant(effect.sync(() => { |
| 888 | const next = a + b |
| 889 | a = b |
| 890 | b = next |
| 891 | const duration = Duration.millis(next) |
| 892 | return [duration, duration] |
| 893 | })) |
| 894 | })) |
| 895 | } |
| 896 | |
| 897 | /** |
| 898 | * Returns a `Schedule` that recurs on the specified fixed `interval` and |