# Function collection

- collection< T , LoadArgs extends any[]>(
  __namedParameters: {
  getKey: (item: T ) => string;
  load?: (key: string, ...args: LoadArgs ) => Promise<any>;
  name: string;
  store: Readable< T []>;
  },
  ): {
  deriveItem: (
  key: Maybe <string>,
  ...args: LoadArgs ,
  ) => Readable<undefined | T >;
  indexStore: ReadableWithGetter <Map<string, T >>;
  loadItem: (key: string, ...args: LoadArgs ) => Promise<undefined | T >;
  }

- #### Type Parameters

  - T
  - LoadArgs extends any[]

  #### Parameters

  - __namedParameters: {
    getKey: (item: T ) => string;
    load?: (key: string, ...args: LoadArgs ) => Promise<any>;
    name: string;
    store: Readable< T []>;
    }

  #### Returns {
  deriveItem: (
  key: Maybe <string>,
  ...args: LoadArgs ,
  ) => Readable<undefined | T >;
  indexStore: ReadableWithGetter <Map<string, T >>;
  loadItem: (key: string, ...args: LoadArgs ) => Promise<undefined | T >;
  }

  - Defined in packages/app/src/collection.ts:6