Skip to content

Documentation / @andrew_l/toolkit / withCacheBucketBatch

Function: withCacheBucketBatch()

withCacheBucketBatch<T, K>(__namedParameters, resolver): WithCacheResult<(values) => Promise<Map<string, Readonly<T>>>>

Beta

In this way we will cache item of resulted array by key.

Useful when we need for example fetch batch of users by ids but took already cached results if it available.

Type Parameters

T extends object

K extends string | number | symbol

Parameters

__namedParameters: WithCacheBucketBatchOptions<T, K>

resolver

Returns

WithCacheResult<(values) => Promise<Map<string, Readonly<T>>>>

Example

ts
TODO

@beta