[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) › intersectSchedules

```ts
function intersectSchedules<OutputA, OutputB, Input>(
  a: Schedule<OutputA, Input>,
  b: Schedule<OutputB, Input>,
): Schedule<[OutputA, OutputB], Input>;
```

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

Combines two schedules with AND semantics.

Continues only while both schedules want to continue. Uses the maximum delay.

### Combining constraints with AND

```ts
import {
  assertErr,
  assertOk,
  done,
  exponential,
  forever,
  intersectSchedules,
  maxElapsed,
  take,
  testCreateDeps,
} from "@evolu/common";

// Retry at most 5 times and only within 30 seconds.
const deps = testCreateDeps();
const step = intersectSchedules(
  take(5)(exponential("1s")),
  maxElapsed("30s")(forever),
)(deps);
assertOk(step(undefined), [[1000, 0], 1000]);
deps.time.advance("30s");
assertErr(step(undefined), done());
```