sindresorhus/p-memoize

Export "in-flight only memoizer"

Ouverte

#53 ouverte le 1 févr. 2023

 (5 commentaires) (1 réaction) (1 personne assignée)TypeScript (32 forks)user submission
enhancementhelp wanted

Métriques du dépôt

Stars
 (441 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur