Skip to content

feat: new util 'waitForServiceEvent'#36

Merged
fratzinger merged 2 commits into
mainfrom
feat/new-util-wait-for-service-event
Jun 23, 2026
Merged

feat: new util 'waitForServiceEvent'#36
fratzinger merged 2 commits into
mainfrom
feat/new-util-wait-for-service-event

Conversation

@fratzinger

Copy link
Copy Markdown
Member

This pull request introduces a new utility function, waitForServiceEvent, to the src/utils module. This utility allows asynchronous waiting for specific Feathers service events, with support for filtering, timeouts, and abort signals. Comprehensive tests and documentation are included to ensure correctness and guide usage.

New Utility: Service Event Awaiting

  • Added waitForServiceEvent utility (src/utils/wait-for-service-event/wait-for-service-event.util.ts) that enables waiting for one or more Feathers service events, with options for filtering emitted records, setting timeouts, and aborting with signals. The utility is fully typed and supports currying for convenient usage.
  • Exported waitForServiceEvent from the main utils index (src/utils/index.ts).
  • Registered waitForServiceEvent in the exported utils list for test coverage (test/index.test.ts).

Testing and Documentation

  • Added comprehensive runtime tests for waitForServiceEvent, covering event filtering, timeouts, abort handling, and listener cleanup (src/utils/wait-for-service-event/wait-for-service-event.util.test.ts).
  • Added type-level tests to validate TypeScript typings and usage patterns for waitForServiceEvent (src/utils/wait-for-service-event/wait-for-service-event.util.test-d.ts).
  • Added a documentation markdown file for waitForServiceEvent (src/utils/wait-for-service-event/wait-for-service-event.util.md).

@fratzinger fratzinger marked this pull request as ready for review June 23, 2026 22:02
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 23, 2026

Copy link
Copy Markdown

Deploying feathers-utils with  Cloudflare Pages  Cloudflare Pages

Latest commit: d44a0a3
Status: ✅  Deploy successful!
Preview URL: https://1f8bfbcd.feathers-utils.pages.dev
Branch Preview URL: https://feat-new-util-wait-for-servi.feathers-utils.pages.dev

View logs

@fratzinger fratzinger merged commit 895d0be into main Jun 23, 2026
9 checks passed
@fratzinger fratzinger deleted the feat/new-util-wait-for-service-event branch June 23, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant