Skip to content

feat(effect): consolidate effect utilities into one - #703

Open
XavierDupessey wants to merge 1 commit into
ngxtension:mainfrom
XavierDupessey:feature-effect
Open

feat(effect): consolidate effect utilities into one#703
XavierDupessey wants to merge 1 commit into
ngxtension:mainfrom
XavierDupessey:feature-effect

Conversation

@XavierDupessey

@XavierDupessey XavierDupessey commented Jul 30, 2026

Copy link
Copy Markdown

Hello,

ngextensions currently contains several utilities built around effects, such as explicitEffect, effectOnceIf, reactive on, and possibly others.

I'd like to get your feedback on introducing a single effect utility that could cover all of these use cases.

To demonstrate the idea, I updated the existing unit tests for those utilities to use the new implementation instead. This should make it easier to compare the different APIs and see how they translate to the proposed one.

Some characteristics of the new utility:

  • It enforces explicit dependencies, which I believe is a good practice.
  • It exposes both the current and previous dependency values.
  • It provides access to the previous return value.
  • It supports deferring the first execution (defer option).
  • It permits to filter specific values with a predicate function (filter option).
  • It allows executing the function only once (once option).

I'm curious to hear your thoughts. Any feedback, suggestions, or concerns are very welcome! 🙂

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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.

1 participant