|
|
|
|
|
by ralusek
662 days ago
|
|
I use WeakMaps all the time. While most cases where I’ve wanted to iterate through a WeakMap are achievable through other means, it usually comes at an inconvenience that usually greatly reduces the utility of using the WeakMap in the first place. If you’re using a WeakMap to avoid having to do lifecycle-type logic of removing from a map(s) under such and such circumstances, it would often be nice to be able to eschew such lifecycle logic by having items be automatically garbage collected, while still being able to iterate through the items in the map. |
|