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

reactivando / use-pubsub-js / 28133808053
100%
master: 80%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 24 Jun 2026 10:31PM UTC
Jobs 1
Files 6
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

24 Jun 2026 10:30PM UTC coverage: 100.0%. Remained the same
28133808053

push

github

web-flow
feat: react19/useSubscribe built on useEffectEvent (opt-in subpath) (#87)

* feat: add react19/useSubscribe built on useEffectEvent (opt-in subpath)

For React 19.2+, an optional useSubscribe that reads the latest handler through
useEffectEvent instead of the handlerRef pattern — closing the small window
where a publish delivered between a handler prop change and the ref-update effect
could invoke the previous handler under concurrent rendering. Same public API.

- New `use-pubsub-js/react19/useSubscribe` subpath (+ typesVersions). The default
  entry is unchanged and stays React 18+ compatible (no useEffectEvent import).
- Tests mirror the default hook (receive, latest-handler-without-resubscribe,
  unmount, unsubscribe/resubscribe, token change, isUnsubscribe). The suite is
  skipped on React < 19.2 (via React.version) so the React-18 CI cell stays green.
- CI: coverage is gated on the React 19 cell only, since the react19 suite is
  intentionally skipped on 18.

125 tests, 100% coverage (on React 19), lint clean, attw + publint green for the
new subpath, e2e 10/10.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(react19): clear error on React <19.2 (CJS); clarify ci + test comments

Adversarial review follow-ups:
- Add a runtime guard so React <19.2 CJS callers get a clear "requires React
  19.2+" error instead of an obscure "useEffectEvent is not a function" (v8-ignored
  — unreachable on the React-19 test platform). Note: ESM consumers on <19.2 fail
  earlier at the named import, which is the documented constraint.
- Comment why the GH Actions `&& '--coverage' || ''` idiom is safe here.
- Clarify that the "latest handler" test asserts external parity (the concurrent
  window useEffectEvent closes isn't reproducible in jsdom).

Not added: e2e import smoke for the subpath — it requires React >=19.2 in the e2e
sandbox (which resolves 19.1.1), and subpath resolution is already covered by
attw + publint. Pre-unmount delive... (continued)

31 of 31 branches covered (100.0%)

Branch coverage included in aggregate %.

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

211 of 211 relevant lines covered (100.0%)

36.1 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28133808053.1 24 Jun 2026 10:31PM UTC 6
100.0
GitHub Action Run
Source Files on build 28133808053
  • Tree
  • List 6
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #28133808053
  • 85b129d1 on github
  • Prev Build on main (#28132971601)
  • Next Build on main (#28134131988)
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