Skip to content

CreateListOptions

Defined in: state/factories.ts:331

T

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

Defined in: state/factories.ts:332


optional keyBy?: (item) => ListKey

Defined in: state/factories.ts:343

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