You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this framework is amazing. I'm super interested in any redux implementation on IOS, eg: ReSwift.
Have a scenario of concurrent action dispatch:
Eg. Concurrent media files downloading in real time chatting. We need to handle the progress and state of all media files. We can use a dictionary to hold the states of all file states. For each chat bubble cell or viewmodel, we can add a event subscriber to listen to the state change and filter the state of the file for this bubble. For Reswift, they only have single queue support for each store. You cannot dispatch actions concurrently. So how does this framework handle this case? Do I have to use multiple stores?
The text was updated successfully, but these errors were encountered:
I don' get why you need concurrent dispatches. Isn't it enough some like this (very simplified example code):
State & Actions:
enumDownloadState{case notStarted
case progress(Double)case done
}// mediaID is a string or somethingletmedia:[MediaID:DownloadState]structDownloadMedia:AsyncAction,ActionWithSideEffect{letid:MediaID// update states to handle start, progress and completion
sideEffect(){letprogressClosure={ progress indispatch(self.progressAction({ $0.progress = progress })}letcompletionClosure={ localURL indispatch(self.completionAction({ $0.progress = progress })}
dependencies.apiManager.getMedia(self.id, progressClosure, completionClosure)}}
Actions are always sequential, but it doesn't matter because the download is actually parallel if yiu dispatch many DownloadMedia.
For the UI you can attach a listener to the store in the vc that handles the collection/table of bubbles instead of using a listener for each bubble.
Take a look at Tempura, if you haven't seen it https://github.com/BendingSpoons/tempura-swift
@bolismauro , failed to receive notifications from your reply. Thanks a lot for the explanation. I would have a try of this framework. For Reswift, we need to manaage the serial queue manually to make sure all actions dispatched are in the same serial queue to make sure they are sequential
Hi, this framework is amazing. I'm super interested in any redux implementation on IOS, eg: ReSwift.
Have a scenario of concurrent action dispatch:
Eg. Concurrent media files downloading in real time chatting. We need to handle the progress and state of all media files. We can use a dictionary to hold the states of all file states. For each chat bubble cell or viewmodel, we can add a event subscriber to listen to the state change and filter the state of the file for this bubble. For Reswift, they only have single queue support for each store. You cannot dispatch actions concurrently. So how does this framework handle this case? Do I have to use multiple stores?
The text was updated successfully, but these errors were encountered: