-
Notifications
You must be signed in to change notification settings - Fork 27
feat: Add hook support. #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a3a6163
to
9c4589b
Compare
src/HookRunner.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the implementation from js-core, but using a factory instead of a class.
if (streamActive) { | ||
connectStream(); | ||
} | ||
return flagValueMap; | ||
}) | ||
.catch(err => { | ||
afterIdentify?.({ status: 'error' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems possible that after identify could be invoked twice if an error is thrown in connectStream? Perhaps not realistically possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a once
helper.
The way this promise chaining is structured is terrible, but I don't want to substantially change it for this. So the once
will ensure it is only called once.
🤖 I have created a release *beep* *boop* --- ## [5.5.0](5.4.0...5.5.0) (2025-04-21) ### Features * Add hook support. ([#116](#116)) ([85c227c](85c227c)) * Inline context in custom events. ([#118](#118)) ([450f8f7](450f8f7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Draft as tests need added first.