Piping data from delegate methods of external dependency back into the reducer #1646
Replies: 3 comments 3 replies
-
My lazy POV is to stay away from async sequences for dealing with long-lived effects until it is fleshed out more. I'm sticking to Combine with |
Beta Was this translation helpful? Give feedback.
-
Hmm. I suppose that makes sense. Shame that the async stuff isn't ready to handle this situation but it did certainly have a Combine-y feel to it. |
Beta Was this translation helpful? Give feedback.
-
I recently started using I found Isowords's use of |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My app has a video streaming feature that works over WebRTC and lets me view the video stream of a remote camera.
The connection process is somewhat complex and I want to keep this hidden from my feature. When I first wrote it my view controller held a reference to the WebRTCClient and set itself as a delegate but I'd like to refactor this into a clean TCA feature.
This is mostly straightforward, but the entire time that the connection is active there are a few delegate methods that could be called at any time and could produce some relevant results for my feature.
How do I handle this delegate situation for a long-lived delegate that could produce multiple results at any time?
My wrapper client which holds my WebRTCClient exposes a simple
connect(_ hostUrl:String)
method to initiate the connection. Do I somehow need to funnel all the delegate activity into an async sequence that is returned by this connect method?Beta Was this translation helpful? Give feedback.
All reactions