3 ms·
good to know pub-sub shenanigans are ubiquitous lol here's my implementation from a while back with `setTimeout` like semantics; used it to avoid prop-drilling
by thewisenerd 2y ago
good to know pub-sub shenanigans are ubiquitous lol
here's my implementation from a while back with `setTimeout` like semantics; used it to avoid prop-drilling in an internal dashboard (sue me)
https://gist.github.com/thewisenerd/768db2a0046ca716e28ff14be6c28538 https://gist.github.com/thewisenerd/768db2a0046ca716e28ff14b...
- tubs 2y agosub => ref = 0 sub => ref = 1 unsub(0) sub => ref = 1 (two subs with same ref!)