API reference@evolu/commonSchedule › tapScheduleInput

function tapScheduleInput<Input>(
  f: (input: Input) => void,
): <Output>(schedule: Schedule<Output, Input>) => Schedule<Output, Input>;

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

Executes a side effect for every input without altering the schedule.

Useful for logging errors during retry or monitoring what values are being processed.

Example

interface MyError extends Typed<string> {}

const retrySchedule: Schedule<Millis, MyError> = exponential("100ms");

// Log each error during retry
const logged = tapScheduleInput((error: MyError) => {
  console.log(`Retrying after error: ${error.type}`);
})(retrySchedule);

// Track retry reasons
const reasons: Array<string> = [];
const tracked = tapScheduleInput((error: MyError) => {
  reasons.push(error.type);
})(retrySchedule);