Are global effects that listen to a large amount of actions a form of anti-pattern? #5100
Unanswered
bederuijter
asked this question in
Q&A
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
In our application, we use a global Effect to refresh a specific data slice. This Effect currently listens to a wide array of actions, as fresh data is required across multiple pages, but not all pages.
The motivation behind this question is that we're in the process of migrating from a monolith to an Nx library structure and hit a roadblock with these global effects. The main problem is that the global Effect now requires imports from almost every feature library in our workspace, making it difficult to maintain clean library boundaries without circular dependencies.
We've explored several options to remedy the problem
All of the above options feel (and most likely are) anti-pattern, which begs the question if our global effect is anti-pattern. So my question is: Is a single Effect listening to many actions considered an anti-pattern? And if so, what is the recommended way to trigger a shared data refresh?"
Thank you for your time 🙏
Beta Was this translation helpful? Give feedback.
All reactions