How to Deal with Side Effects of a Shared Client Dependency? #247
Unanswered
HeyAbdelali
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a shared dependency called CartClient that manages a shopping cart. The cart allows various operations such as adding a product or applying a discount. It also has a publisher property that emits operations (e.g., .addCartLine).
Previously, the cart was a property of the order store, and I was listening to these operations to save the cart state in the database. Now that the cart is a shared client, I'm wondering how to handle this.
Should I manage these side effects within the dependency itself, or should some parts of the application listen to these operations? What are the best practices for dealing with such side effects in a shared client dependency?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions