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

贡献者指南