duix
duix copied to clipboard
Use native Set and Map
What about using Set for subscriber list, and Map for key => ... ?
I'm not against it, just tell me about the benefits.
Considering that duix
has a really small code, and super simple, I kind of ignore performance benefits. But, if there are are other benefits, I could consider it.
Here https://github.com/BrodaNoel/duix/issues/5 someone already talked about adding Set and Map.
More than Set and Map, a WeakMap would be good to have a "weak" pointer to the element. Or waiting for weakReferences to be supported everywhere?