API reference@evolu/commonSchedule › tapScheduleOutput

function tapScheduleOutput<Output>(
  f: (output: Output) => void,
): <Input>(schedule: Schedule<Output, Input>) => Schedule<Output, Input>;

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

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

Useful for logging, monitoring, or debugging without changing schedule behavior.

Example

// Log each delay for debugging
const logged = tapScheduleOutput((delay: Millis) => {
  console.log(`Next delay: ${delay}ms`);
})(exponential("100ms"));

// Track metrics
const recorded: Array<Millis> = [];
const tracked = tapScheduleOutput((delay: Millis) => {
  recorded.push(delay);
})(retryStrategyAws);