Skip to content

feat: Add hook support. - #116

Merged
kinyoklion merged 10 commits into
mainfrom
rlamb/add-hooks-support
Apr 10, 2025
Merged

feat: Add hook support.#116
kinyoklion merged 10 commits into
mainfrom
rlamb/add-hooks-support

Conversation

@kinyoklion

Copy link
Copy Markdown
Member

Draft as tests need added first.

@kinyoklion
kinyoklion force-pushed the rlamb/add-hooks-support branch from a3a6163 to 9c4589b Compare April 3, 2025 21:48
Comment thread src/HookRunner.js

Copy link
Copy Markdown
Member Author

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.

@kinyoklion
kinyoklion marked this pull request as ready for review April 9, 2025 00:18
@kinyoklion
kinyoklion requested a review from a team as a code owner April 9, 2025 00:18
@kinyoklion
kinyoklion requested a review from Vadman97 April 9, 2025 00:18
Comment thread typings.d.ts Outdated
Comment thread typings.d.ts Outdated
Comment thread src/index.js
return flagValueMap;
})
.catch(err => {
afterIdentify?.({ status: 'error' });

Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Member Author

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.

Comment thread src/index.js
@kinyoklion
kinyoklion requested a review from tanderson-ld April 9, 2025 21:38
@kinyoklion
kinyoklion merged commit 85c227c into main Apr 10, 2025
@kinyoklion
kinyoklion deleted the rlamb/add-hooks-support branch April 10, 2025 20:04
kinyoklion pushed a commit that referenced this pull request Apr 21, 2025
🤖 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>
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.

2 participants