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
- Host: GitHub
- URL: https://github.com/ariafallah/weak-memoize
- Owner: AriaFallah
- Created: 2016-04-12T06:00:58.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-24T04:14:54.000Z (over 9 years ago)
- Last Synced: 2025-04-14T12:06:39.925Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 32.2 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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