MCPcopy Index your code
hub / github.com/Effect-TS/effect / repeatForever

Function repeatForever

packages/effect/src/internal/schedule.ts:1269–1284  ·  view source on GitHub ↗
(self: Schedule.Schedule<Out, In, Env>)

Source from the content-addressed store, hash-verified

1267
1268/** @internal */
1269export const repeatForever = <Env, In, Out>(self: Schedule.Schedule<Out, In, Env>): Schedule.Schedule<Out, In, Env> =>
1270 makeWithState(self.initial, (now, input, state) => {
1271 const step = (
1272 now: number,
1273 input: In,
1274 state: any
1275 ): Effect.Effect<[any, Out, ScheduleDecision.ScheduleDecision], never, Env> =>
1276 core.flatMap(
1277 self.step(now, input, state),
1278 ([state, out, decision]) =>
1279 ScheduleDecision.isDone(decision)
1280 ? step(now, input, self.initial)
1281 : core.succeed([state, out, decision])
1282 )
1283 return step(now, input, state)
1284 })
1285
1286/** @internal */
1287export const repetitions = <Out, In, R>(self: Schedule.Schedule<Out, In, R>): Schedule.Schedule<number, In, R> =>

Callers

nothing calls this directly

Calls 2

makeWithStateFunction · 0.85
stepFunction · 0.70

Tested by

no test coverage detected