| 1277 | export const repeatForever = <Env, In, Out>(self: Schedule.Schedule<Out, In, Env>): Schedule.Schedule<Out, In, Env> => |
| 1278 | makeWithState(self.initial, (now, input, state) => { |
| 1279 | const step = ( |
| 1280 | now: number, |
| 1281 | input: In, |
| 1282 | state: any |
| 1283 | ): Effect.Effect<[any, Out, ScheduleDecision.ScheduleDecision], never, Env> => |
| 1284 | core.flatMap( |
| 1285 | self.step(now, input, state), |
| 1286 | ([state, out, decision]) => |
| 1287 | ScheduleDecision.isDone(decision) |
| 1288 | ? step(now, input, self.initial) |
| 1289 | : core.succeed([state, out, decision]) |
| 1290 | ) |
| 1291 | return step(now, input, state) |
| 1292 | }) |
| 1293 | |