feat: new util 'waitForServiceEvent'#36
Merged
Merged
Conversation
Deploying feathers-utils with
|
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new utility function,
waitForServiceEvent, to thesrc/utilsmodule. 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
waitForServiceEventutility (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.waitForServiceEventfrom the main utils index (src/utils/index.ts).waitForServiceEventin the exported utils list for test coverage (test/index.test.ts).Testing and Documentation
waitForServiceEvent, covering event filtering, timeouts, abort handling, and listener cleanup (src/utils/wait-for-service-event/wait-for-service-event.util.test.ts).waitForServiceEvent(src/utils/wait-for-service-event/wait-for-service-event.util.test-d.ts).waitForServiceEvent(src/utils/wait-for-service-event/wait-for-service-event.util.md).