jaredwray/cacheable

Bug in docs: "Create single cache store synchronously" doesn't pass options to store

Juraj-Masiar opened this issue · 1 comments

Describe the bug
In the example:

// Create memory cache synchronously
const memoryCache = createCache(memoryStore(), {
  max: 100,
  ttl: 10 * 1000 /*milliseconds*/,
});

The options are passed to the createCache, but not to the memoryStore function!
This then means that both "max" and "ttl" options have no effect, since they are both used only by the store.

Unlike when using async caching, which passes the options to the store:
https://github.com/jaredwray/cache-manager/blob/0d5b97d03f5283605a82984dc93803414180df7b/packages/cache-manager/src/caching.ts#L90

@Juraj-Masiar - thanks for finding this and we have updated the docs. Should be published shortly