Fang Jin
Jan 12, 2022

--

wow, thanks man.

I tried your solution. Yes it works.

I guess if I had used the weakMap instead of a object as hash, that should avoid running this problem at the first place.

And maybe that's the reason why Rust doesn't run into, well, that's odd, actually Rust asks to use a string key as hash as well. Maybe that hashing algorithm is not a toString(). haha. Ok, i'll look into more.

Thanks a ton!

--

--

Fang Jin
Fang Jin

Written by Fang Jin

Front-end Engineer, book author of “Designing React Hooks the Right Way” and "Think in Recursion"

Responses (1)