-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat: Add initial support for hooks #370
Conversation
3ac5430
to
947b129
Compare
947b129
to
65ffac7
Compare
public typealias EvaluationSeriesData = [String: Any] | ||
|
||
/// Protocol for extending SDK functionality via hooks. | ||
public protocol Hook { |
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.
Is this forward compatible? I'm not super familiar with swift protocols.
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.
Yes. When we add a new method on this protocol, we will need to also provide an extension to that protocol with a default implementation.
/// Implementation specific hook data for evaluation stages. | ||
/// | ||
/// Hook implementations can use this to store data needed between stages. | ||
public typealias EvaluationSeriesData = [String: Any] |
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.
This should be immutable if possible (I read 'possible' as not requiring excessive effort and not being inconvenient for consumption). Is there a simple way to achieve immutability here?
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.
Dictionaries in Swift are passed by value (but lazily copied). So providing a dictionary to a function is already an immutable operation.
🤖 I have created a release *beep* *boop* --- ## [9.7.0](9.6.2...9.7.0) (2024-05-02) ### Features * Add initial support for hooks ([#370](#370)) ([93239fc](93239fc)) --- 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> Co-authored-by: LaunchDarklyReleaseBot <LaunchDarklyReleaseBot@launchdarkly.com>
No description provided.