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

```ts
function collectUntilScheduleOutput<Output>(
  predicate: Predicate<Output>,
): <Input>(
  schedule: Schedule<Output, Input>,
) => Schedule<readonly Output[], Input>;
```

Defined in: [packages/common/src/Schedule.ts:1221](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Schedule.ts#L1221)

Collects outputs until a predicate becomes true.

Mirror of [collectWhileScheduleOutput](https://evolu.dev/docs/api-reference/common/Schedule/functions/collectWhileScheduleOutput) — stops collecting when the
predicate returns true (inclusive of the matching output).

### Example

```ts
// Collect delays until reaching 1 second
const untilLarge = collectUntilScheduleOutput((delay: Millis) => delay >= 1000)(
  exponential("100ms"),
);
// Outputs: [100], [100, 200], [100, 200, 400], [100, 200, 400, 800], stops
```