Does anyone know of the equivalent of WeakMap, but where the values don't prevent garbage collection? Want to lookup objects using a string as key, but not prevent GC either. We can always use LRUs, but ideally there'd be a language construct to simplify this.
-
-
Replying to @yoshuawuyts
Need WeakRef to do this, but it is stalled due to GC observability concerns. I wrote an impl for V8 but
@DeanTribble is probably who you would want to chat with to get through TC39. 3rd party real world use cases would help.1 reply 0 retweets 1 like
Replying to @bradleymeck @DeanTribble
Oh nice! Yeah, our use case is to replace an LRU cache with something that removes references once elements are removed from the DOM. Keeping track of things in two places is really hard. It's easier to keep track of them in just one place. This allows for that (:
5:45 AM - 17 Jan 2018
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.