API reference@evolu/commonSchedule › unionSchedules

function unionSchedules<OutputA, OutputB, Input>(
  a: Schedule<OutputA, Input>,
  b: Schedule<OutputB, Input>,
): Schedule<OutputA | OutputB, Input>;

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

Combines two schedules with OR semantics.

Continues while either schedule wants to continue. Uses the minimum delay.

Example

// Retry up to 5 times OR up to 30 seconds, whichever is longer
const either = unionSchedules(
  take(5)(exponential("1s")),
  maxElapsed("30s")(forever),
);