DEV Community

Discussion on: Oi You! Stop Requesting Everything: A Simple Guide to Memoization

Collapse
 
blacklight profile image
Fabio Manganiello

Great pattern, but it's good to point out that it only works within the same "run" of the application/page. Your cache will be emptied by a page reload. I commonly use a similar pattern, but relying on the browser storage instead of a closure object.