- 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>;
} 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>;
}