Skip to content

Function: createPoolBuilder() ​

ts
function createPoolBuilder<TItem>(id, options?): PoolBuilder<TItem>;

Defined in: builders/create-pool-builder.ts:26

Creates a fluent PoolBuilder for P.pool(id).

Defaults the selection strategy to 'round-robin' and validates at .toAST() time that at least one candidate item has been registered via .with(...).

Type Parameters ​

Type ParameterDefault typeDescription
TItem extends ASTNodeASTNodePool candidate AST node type.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the pool.
options?CreatePoolBuilderState<TItem>Optional internal copy-on-write state.

Returns ​

PoolBuilder<TItem>

Frozen PoolBuilder instance.

Released under the MIT License.