MCPcopy Create free account
hub / github.com/effect-app/libs / fromStep

Function fromStep

repos/effect/packages/effect/src/Schedule.ts:326–336  ·  view source on GitHub ↗
(
  step: Effect<
    (now: number, input: Input) => Pull.Pull<[Output, Duration.Duration], ErrorX, Output, EnvX>,
    Error,
    Env
  >
)

Source from the content-addressed store, hash-verified

324 * import { Duration, Effect, Schedule } from "effect"
325 *
326 * // Extract step function from an existing schedule
327 * const schedule = Schedule.exponential("100 millis").pipe(Schedule.upTo({ times: 3 }))
328 *
329 * const program = Effect.gen(function*() {
330 * const stepFn = yield* Schedule.toStep(schedule)
331 *
332 * // Use the step function directly for custom logic. The timestamp is
333 * // supplied by the caller, so tests can pass a deterministic value.
334 * const now = 0
335 * return yield* stepFn(now, "input")
336 * })
337 *
338 * await Effect.runPromise(program) // => [Duration.millis(100), Duration.millis(100)]
339 * ```

Callers 7

fromStepWithMetadataFunction · 0.85
Schedule.tsFile · 0.85
cronFunction · 0.85
delaysFunction · 0.85
fibonacciFunction · 0.85
passthroughFunction · 0.85
unfoldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…