feat(create-notifier): add support for dependencies#661
feat(create-notifier): add support for dependencies#661endlacer wants to merge 2 commits intongxtension:mainfrom
Conversation
Summary of ChangesHello @endlacer, 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 significantly enhances the 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
|
|
View your CI Pipeline Execution ↗ for commit 374f06d
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Code Review
This pull request introduces dependency tracking to createNotifier, which is a great enhancement. The implementation is clever, but it currently relies on linkedSignal, a private Angular API. This poses a significant risk for library maintenance, and I've flagged it as a critical issue. Additionally, I've provided suggestions to improve the TypeScript typings for a better developer experience and corrected an error in the documentation example. The new tests are well-written and effectively cover the new functionality.
| options?.deps?.forEach((dep) => dep()); // Track all dependencies | ||
|
|
||
| // - when deps exist, the notifier should start at 1, because it immediatley emits. | ||
| // -without any deps, it is only based on increments. and those should start at 0. | ||
| return options?.deps?.length && options?.depsEmitInitially ? 1 : 0; | ||
| }, |
There was a problem hiding this comment.
After the options object is merged with DEFAULT_OPTIONS on line 20, it is guaranteed to be defined. Therefore, the optional chaining (?.) used here is unnecessary and can be misleading. Removing it would improve code clarity.
Additionally, there is a small typo in the comment on line 28 ('immediatley' should be 'immediately').
| options?.deps?.forEach((dep) => dep()); // Track all dependencies | |
| // - when deps exist, the notifier should start at 1, because it immediatley emits. | |
| // -without any deps, it is only based on increments. and those should start at 0. | |
| return options?.deps?.length && options?.depsEmitInitially ? 1 : 0; | |
| }, | |
| options.deps.forEach((dep) => dep()); // Track all dependencies | |
| // - when deps exist, the notifier should start at 1, because it immediately emits. | |
| // -without any deps, it is only based on increments. and those should start at 0. | |
| return options.deps.length && options.depsEmitInitially ? 1 : 0; | |
| }, |
|
Hi @endlacer |
85c615f to
374f06d
Compare
true, but i would prefer the option-syntax though. |
#535
Added options.deps where signals can be specified, that trigger the notifier
Made it so, that the value inside notify() also increases when the signals emit