feat(angular): add convenience value method alongside details method in generated service#228
Conversation
a881233 to
3c86e7c
Compare
…in generated service Signed-off-by: backtrack5r3 <flennertom@gmail.com>
3c86e7c to
5cb9dbe
Compare
Summary of ChangesHello @tomflenner, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the generated Angular service by adding a convenience method for retrieving flag values directly as Observables. This simplifies common use cases, reduces boilerplate, and aligns the Angular generator with the C# generator, improving developer ergonomics. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces convenience methods to the generated Angular service, allowing direct access to flag values as Observable<T> instead of Observable<EvaluationDetails<T>>. This improves developer ergonomics by reducing boilerplate. The changes include adding map operator imports and generating new methods that pipe the existing Details methods to extract the value property. New integration tests have also been added to cover these convenience methods.
The rxjs docs gives best practices : https://rxjs.dev/guide/importing#new-in-rxjs-v720 Signed-off-by: backtrack5r3 <flennertom@gmail.com>
24215a3 to
61c9536
Compare
This PR
Adds a new convenience method in the generated Angular service that directly returns an
Observable<T>of the flag value, in addition to the existingget<FlagName>Detailsmethod returningObservable<EvaluationDetails<T>>.Today, the generator produces:
In most modern Angular applications (especially when using Signals), consumers are primarily interested in the flag value:
This PR adds a generated convenience method:
This allows a simpler usage:
Observable<T>.pipe(map(details => details.value))boilerplateRelated Issues
Fixes #226
Notes
This is a non-breaking, additive feature.
The existing
get<FlagName>Detailsmethod remains unchanged to preserve access to fullEvaluationDetailswhen needed.How to test
make test-integration