Skip to main content

Function: partition()

partition<T>(decision, config?): Processable<readonly T[], Partitioned<T>>

Defined in: packages/core/src/graph/operations.ts:279

Split a list by a per-item decision, keeping both halves.

Distinct from filter, which drops what fails: the rejected set is usually the point — what a review queue is for, or what a report explains.

The decision is any Processable<T, boolean>, so step(x => x.score > 5) and a model-answered predicate go in the same slot. That is the whole reason this is not welded to one conditional type.

Type Parameters​

T​

T

Parameters​

decision​

Child<T, boolean>

config?​

concurrency?​

number

Returns​

Processable<readonly T[], Partitioned<T>>