Skip to content

CreateListOptions

Defined in: state/factories.ts:329

T

optional default?: Iterable<T, any, any> | (() => Iterable<T>)

Defined in: state/factories.ts:330


optional keyBy?: (item) => ListKey

Defined in: state/factories.ts:341

Derive a domain key from each item to enable O(1) keyed lookup via findId / getByKey / upsert. Without it those methods throw. The key field may change via update; the index reindexes on every mutation.

Keys are unique: a keyed list holds at most one item per derived key. add, update, and upsert throw if the operation would leave two live items sharing a key. This keeps the key→id index unambiguous — every key resolves to exactly one item.

T

ListKey

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/core.md.