[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:1902](https://github.com/evoluhq/evolu/blob/dd96d79f1dbe9a49fa12ce8e0aa7d3d0177795ca/packages/common/src/Schedule.ts#L1902)

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());
```