sindresorhus/p-memoize

Export "in-flight only memoizer"

Open

#53 geöffnet am 1. Feb. 2023

Auf GitHub ansehen
 (5 Kommentare) (1 Reaktion) (1 zugewiesene Person)TypeScript (441 Stars) (32 Forks)user submission
enhancementhelp wanted

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