Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export default function memoize<A extends unknown[], R extends unknown, T extend
return function (this: T, ...args: A) {
const id = hash.apply(this, args)
if (cache.has(id)) return cache.get(id)
const result = fn.apply(this, args)
let result = fn.apply(this, args)
if (result instanceof Promise) {
// eslint-disable-next-line github/no-then
result.catch(error => {
result = result.catch(error => {
cache.delete(id)
throw error
})
Expand Down