Skip to content

API reference > @kontsedal/olas-core > CollectionHomogeneousOptions

CollectionHomogeneousOptions type ​

Homogeneous form of ctx.collection: one controller def for every item, with propsOf projecting each item to the controller's Props. Construct happens once per new key — propsOf is **not** re-applied for unchanged keys.

Signature:

typescript
type CollectionHomogeneousOptions<Item, K, Props, Api, TDeps = AmbientDeps> = {
  readonly source: ReadSignal<readonly Item[]>;
  readonly keyOf: (item: Item) => K;
  readonly controller: ControllerDef<Props, Api>;
  readonly propsOf: (item: Item) => Props;
  readonly factory?: never;
  readonly propsFor?: never;
  readonly deps?: Partial<TDeps>;
};

References: AmbientDeps, ReadSignal, ControllerDef

Released under the MIT License.