Complex use of multiple dependencies and how to model it? #2322
Unanswered
oliverfoggin
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
Uh oh!
There was an error while loading. Please reload this page.
-
We have a reducer and a view in our app that can be presented from two different places.
Lets say it is a chat view with a stream of incoming messages and a function to send a message. Something like...
Obvs this goes through a dependency ... BUT... the dependency in each case is quite complex and cutting it down just for Chat stuff wouldn't really be possible.
So for now we've created a
ChatReducer
with aninit
that takes these functions as parameters.That way, the different places that use the ChatView and ChatReducer can use their own dependency and pass in functions to the
ChatReducer
use it.i.e.
And we have something else in the
FeatureTwoWithChat
also.Does this seem like a good pattern?
Is there something else that we could do that would make this work also?
We didn't really want the Chat to have all of the different dependencies in it but still need the ability to use it in both places.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions