API reference@evolu/commonSchedule › collectScheduleInputs

function collectScheduleInputs<Output, Input>(
  schedule: Schedule<Output, Input>,
): Schedule<readonly Input[], Input>;

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

Collects all inputs into an array.

Each step outputs an array containing all inputs received so far. Mirror of collectAllScheduleOutputs but for inputs.

Collecting inputs

import {
  assertOk,
  collectScheduleInputs,
  exponential,
  take,
  testCreateDeps,
  type Millis,
  type Schedule,
} from "@evolu/common";

const retries: Schedule<Millis, string> = take(3)(exponential("100ms"));
// Keep every error received during retry.
const errorHistory = collectScheduleInputs(retries);
const step = errorHistory(testCreateDeps());
step("network");
assertOk(step("timeout"), [["network", "timeout"], 200]);