Keeping external models out of your reducer #1675
Replies: 2 comments 2 replies
-
Hmm, maybe all the WebRTC talk made this question not general enough. I suppose more generally the problem would be when you have a client that requires some direct interaction with your view layer. In this case my view layer needs to pass an instance of a UIView subclass that the client uses. Maybe it's permissible to pass this UIView subclass to my client by invoking an Action on my Reducer but it feels wrong to have this weird class in my Reducer. Maybe I'm just worrying too much about it though. |
Beta Was this translation helpful? Give feedback.
-
Is your WebRTC code open source? I used Stasels binaries and bridged to structurally concurrency. Might benefit us both to share code, cannot share now but later. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have an app that connects to a remote video feed over WebRTC.
I've managed to move most of the connection handling code out into a Client that exists outside my feature but there is one area where I'm having trouble keeping one of these WebRTC-related classes out of my reducer.
There's a lot of initial activity that my feature client needs to do to set up the connection and a few other clients it needs to interact with (WebRTC, SignalingClient, Kinesis) and once the connection is established I need to provide the WebRTC client with a view that the video will be rendered into. The type of this view is
RTCVideoRenderer
.Right now I'm observing a
connectionReady
property on my state and then sending thisRTCVideoRenderer
in an action.renderInto(RTCVideoRenderer)
. This feels really gross to do. It feels like my reducer shouldn't have anything to do with thisRTCVideoRenderer
class but I don't really know how I should be bridging this gap between my external WebRTC client and my view that needs to render the video.Any one have any ideas about how to handle this type of situation?
Beta Was this translation helpful? Give feedback.
All reactions