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

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

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 24 Jun 2026 05:11PM UTC
Jobs 1
Files 4
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 05:11PM UTC coverage: 100.0%. Remained the same
28116121924

push

github

web-flow
feat(v2-M1): internal pub/sub module + isolation & parity tests (not yet wired) (#71)

* feat(v2-M1): internal pub/sub module + isolation & parity tests (not yet wired)

Builds the dependency-free internal bus at src/pubsub/index.ts per the locked
design (09):
- `PubSub` singleton: untyped, HIERARCHICAL dotted topics; `createPubSub<E>()`:
  flat, fully-typed bus. Public surface: publish/subscribe/on/subscribeOnce/
  unsubscribe(token|handler)/clearAllSubscriptions.
- async setTimeout(0) delivery; subscribers snapshotted at publish time across
  every hierarchy level; per-subscriber error isolation (async re-throw).
- forward + reverse index (O(1) unsubscribe-by-token); empty channels pruned;
  symbol tokens keyed by identity (no stringification, no dotted walk).
- on(token, handler, { signal }) returns a cleanup fn and removes the abort
  listener on manual unsubscribe; subscribeOnce unsubscribes before invoking.

Tests:
- src/pubsub/pubsub.spec.ts — 26 in-isolation unit tests; 100% coverage of the
  module (incl. symbol-identity, AbortSignal, error re-throw, hierarchical).
- src/pubsub/parity.spec.ts — differential test vs pubsub-js (kept as dep);
  identical shared-surface scenarios pass for BOTH buses (incl. hierarchical).
- vitest.config.ts: enable 100% coverage thresholds (branches/functions/lines/
  statements).

NOT wired into the hooks yet (M2 swaps the imports). Full suite 102 passing +
1 todo; lint/tsc/build/e2e/attw/publint all green; coverage 100%.

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

* fix(v2-M1): make subscribeOnce idempotent (review-found double-fire)

Module review caught that subscribeOnce could fire twice: when two publishes
occur in the same tick before the first delivery, publish() snapshots the
wrapper into BOTH dispatches, and the second removeById() was a no-op while
the handler still ran. Added a `fired` guard so the wrapper is idempotent
regardless of how many snapshots captured it. Added two ... (continued)

25 of 25 branches covered (100.0%)

Branch coverage included in aggregate %.

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

157 of 157 relevant lines covered (100.0%)

18.52 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28116121924.1 24 Jun 2026 05:11PM UTC 4
100.0
GitHub Action Run
Source Files on build 28116121924
  • Tree
  • List 4
  • 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 #28116121924
  • e2605abc on github
  • Prev Build on main (#28114972943)
  • Next Build on main (#28116701717)
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