[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Schedule](https://evolu.dev/docs/api-reference/common/Schedule) › unionSchedules

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

Defined in: [packages/common/src/Schedule.ts:1910](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Schedule.ts#L1910)

Combines two schedules with OR semantics.

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

### Combining constraints with OR

```ts
import {
  assertErr,
  assertOk,
  done,
  spaced,
  take,
  testCreateDeps,
  unionSchedules,
} from "@evolu/common";

// The second policy keeps the union alive after the first one stops.
const either = unionSchedules(
  take(1)(spaced("100ms")),
  take(2)(spaced("200ms")),
);
const step = either(testCreateDeps());
assertOk(step(undefined), [100, 100]);
assertOk(step(undefined), [200, 200]);
assertErr(step(undefined), done());
```