Does below snippet considered as multiple streams?...
# orbit-mvi
Does below snippet considered as multiple streams? Also, is it currently possible to do this approach (in snippet)? Detailed in thread~
There’s a usecase in our apps to fetch 3 different APIs inside 1 screen, e.g:
Header 1
1. list item 1 2. … 3. list item n
Header 2
1. list item 1 2. … 3. list item n
Header 3
1. list item 1 2. … 3. list item n fetching this different list in parallel, also has it’s side effect for each service, e.g: empty state, loading animation, loaded animation
there’s nothing stopping you from doing that. However, please note that
will suspend until the relevant stream completes. This means that unless you
a separate coroutine for each
call it won’t get past the first
🤯 1
worth doing that on a
too so as not to overload the orbit event loop
coroutineScope { }
can be used in a suspending block for parallel decomposition
K 1
❤️ 1
🎉 1
🙏 1
to summarise ☝️
I’m not sure if the dispatchers are absolutely necessary, but just to be on the safe side 😉
ah, that’s great, thanks a lot for the code snippet example as well ❤️ K
found official docs from android regarding the parallel decomposition: thanks for take time to write the above snippet and giving us a hint to where should we look for references, especially the parallel decomposition part~ ❤️
🙏 1