sindresorhus/p-memoize

Export "in-flight only memoizer"

開放

#53 建立於 2023年2月1日

 (5 則留言) (1 個反應) (1 位負責人)TypeScript (32 個分叉)user submission
enhancementhelp wanted

倉庫指標

星標
 (441 顆星)
PR 合併指標
 (30 天內沒有已合併 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

貢獻者指南