• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

reactivando / use-pubsub-js / 17783295596
99%
master: 80%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 17 Sep 2025 12:59AM UTC
Jobs 1
Files 3
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Sep 2025 12:58AM UTC coverage: 98.649% (+0.1%) from 98.551%
17783295596

push

github

web-flow
fix(hooks): correct useSubscribe handler updates (#41)

The useSubscribe hook was not correctly handling updates to the handler function. When a component using the hook re-rendered with a new handler, the hook would not unsubscribe the old handler, leading to stale closures and memory leaks.

This commit fixes the issue by using a ref to store the latest handler function and ensuring that the subscription always calls the most current handler. It also properly unsubscribes the old handler when the component unmounts or when the dependencies change.

A test case has been added to verify that the fix works as expected.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>

26 of 27 branches covered (96.3%)

Branch coverage included in aggregate %.

23 of 23 new or added lines in 1 file covered. (100.0%)

120 of 121 relevant lines covered (99.17%)

8.31 hits per line

Jobs
ID Job ID Ran Files Coverage
1 17783295596.1 17 Sep 2025 12:59AM UTC 3
98.65
GitHub Action Run
Source Files on build 17783295596
  • Tree
  • List 3
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #17783295596
  • ce68dea6 on github
  • Prev Build on main (#17754510816)
  • Next Build on main (#17783904110)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc