hookuspocus
hookuspocus copied to clipboard
WeakMap vs Map
I want to ask. Is there are reasons to fallback to Map
when WeakMap
is not available?
https://github.com/michael-klein/hookuspocus/blob/d77f0b4dac894d1c945c02f9b837320ee8ac39bb/src/core.js#L1
https://github.com/michael-klein/hookuspocus/blob/d77f0b4dac894d1c945c02f9b837320ee8ac39bb/src/core.js#L7
The way I see it Map
won't accept objects as keys. There's an alternative to WeakMap
if it's not available by using polyfill weakmap-polyfill by @polygonplanet