API reference@evolu/commonSchedule › untilScheduleInput

function untilScheduleInput<Input>(
  predicate: Predicate<Input>,
): <Output>(schedule: Schedule<Output, Input>) => Schedule<Output, Input>;

Defined in: packages/common/src/Schedule.ts:846

Continues until the input satisfies a predicate.

Stops (returns Err(Done<void>)) when Predicate returns true. Useful for stopping retry on specific error conditions.

Example

interface MyError extends Typed<"Transient" | "Fatal"> {}

// Stop retrying on fatal errors
const stopOnFatal = untilScheduleInput(
  (error: MyError) => error.type === "Fatal",
)(exponential("100ms"));