sindresorhus/p-memoize

Export "in-flight only memoizer"

Offen

#53 geöffnet am 01.02.2023

 (5 Kommentare) (1 Reaktion) (1 zugewiesene Person)TypeScript (32 Forks)user submission
enhancementhelp wanted

Repository-Metriken

Stars
 (441 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

I don't know what this means:

pMemoize(fn, {cache: false})

I have to document it every time:

pMemoize(fn, {cache: false /* only while pending */})

The module can export a more readable helper instead:

export const pMemoizePending = (fn, opts) => pMemoize(fn, {...opts, cache: false})

Note: the types of opts should exclude cache

Some tags could also be added to package.json

Contributor Guide