sindresorhus/p-memoize

Export "in-flight only memoizer"

オープン

#53 opened on 2023/02/01

 (5 件のコメント) (1 件のリアクション) (1 人の担当者)TypeScript (32 件のフォーク)user submission
enhancementhelp wanted

Repository metrics

Stars
 (441 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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

コントリビューターガイド