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

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

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 17 Sep 2025 12:59AM UTC
Files 3
Run time 0s
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.1

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 %.

120 of 121 relevant lines covered (99.17%)

8.31 hits per line

Source Files on job 17783295596.1
  • 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 Build 17783295596
  • ce68dea6 on github
  • Prev Job for on main (#17754510816.1)
  • Next Job for on main (#17783904110.1)
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