duix icon indicating copy to clipboard operation
duix copied to clipboard

Use native Set and Map

Open jehon opened this issue 4 years ago • 3 comments

What about using Set for subscriber list, and Map for key => ... ?

jehon avatar May 25 '20 07:05 jehon

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.

BrodaNoel avatar May 25 '20 09:05 BrodaNoel

Here https://github.com/BrodaNoel/duix/issues/5 someone already talked about adding Set and Map.

BrodaNoel avatar May 30 '20 02:05 BrodaNoel

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?

jehon avatar Jun 01 '20 17:06 jehon