← You're Leaking Memory With That Cache. WeakMap Fixes It.
Playground

WeakRef & FinalizationRegistry — leak-safe cache playground

preview

Edits run in a sandbox in your browser — nothing is saved and nothing leaves the page.