An open API service indexing awesome lists of open source software.

https://github.com/ariafallah/weak-memoize

Self-invalidating memoization for async functions
https://github.com/ariafallah/weak-memoize

Last synced: over 1 year ago
JSON representation

Self-invalidating memoization for async functions

Awesome Lists containing this project

README

          

# Weak Memoize

Memoizes async functions, caching the returned promise, but later deleting the promise
from the cache once it resolves.

## Why

I made this to address the problem I encountered here:
> [Prevent multiple async calls from all attempting to refresh an expired OAuth token][1]

[1]: http://codereview.stackexchange.com/q/125601/69082