Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by thewisenerd

3 months 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/768db2a0046ca716e28ff14b...

1 comment

thewisenerd

Reply

tubs  3 months ago

    sub => ref = 0
    sub => ref = 1
    unsub(0)
    sub => ref = 1 (two subs with same ref!)

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities