feat(pulse-core): add filter predicate to EventEngine.subscribe()#241
Open
Jayking40 wants to merge 1 commit intodetermined-001:mainfrom
Open
feat(pulse-core): add filter predicate to EventEngine.subscribe()#241Jayking40 wants to merge 1 commit intodetermined-001:mainfrom
Jayking40 wants to merge 1 commit intodetermined-001:mainfrom
Conversation
|
@Jayking40 is attempting to deploy a commit to the determined's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Jayking40 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Only events for which filter returns
trueare delivered to thatwatcher. All watchers without a filter behave exactly as before.
Changes
optional filter predicate so callers get full TypeScript support.
predicate in a per-address
filtersmap; the existing stop handlernow also removes the entry from that map when the watcher is stopped.
predicate inside a try/catch. A throwing predicate is treated as a
rejection and a
[pulse-core]warning is logged; the engine keepsrunning.
emitting both the specific event type and the
*wildcard. Thepayment-type resolution was also deduplicated as a minor side-effect.
filter accepts, filter rejects, and filter throws (engine survives).
Testing
The full
@orbital/pulse-coretest suite was run with:pnpm --filter @orbital/pulse-core testResult: 17 tests pass, 0 failures.
New tests added under
describe("subscribe() filter predicate"):truefalse*Closes #83