Well explained thanks ! Can you propose an implementation of FlowModelStore that no longer use `reduce()` as is depreciated (kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.channels/reduce.html ) ?
@kanawish4 жыл бұрын
@@RazvanBunea Thanks for the question! You're looking at `Intent.reduce(oldState:T)` and not ` ReceiveChannel.reduce(op)`. Naming clashes do confuse things, something I might review in future samples. It's worth mentioning that Kotlin's Flow is actively being worked on, and as more of the new Flow features are making it into production, it will be possible to improve on the FlowModelStore implementation. I recommend keeping an eye on the following if you're interested in the nitty-gritty: github.com/Kotlin/kotlinx.coroutines/pull/1354 github.com/Kotlin/kotlinx.coroutines/issues/1973 github.com/Kotlin/kotlinx.coroutines/pull/1974 github.com/Kotlin/kotlinx.coroutines/issues/2034 [Btw, sorry for the slow answer, looks like I hadn't yet turned on "notifications" on this video back when you asked.]
@kanawish4 жыл бұрын
Thanks folks! Happy to answer any questions :)
@tobiaspreuss4 жыл бұрын
Did you see Razvan Bunea's question down here?
@kanawish4 жыл бұрын
@@tobiaspreuss I in fact did not! Thanks for the ping :) I'll be answering it shortly.
@filippalexandrov1554 Жыл бұрын
Amazing vid, gr8 thanks
@HoggsvilleAdventures4 жыл бұрын
Great video, thanks for sharing.
@AmrYousef4 жыл бұрын
Great video, Thanks!. Curious why are you using Channel to pass intents to the store in FlowModelStore. Why not just use reduce then offer the new value directly every time process() is called.
@kanawish4 жыл бұрын
Hello Amr, thanks for the question :) The idea here is to make all calls to `reduce()` happen from a singular coroutine scope. You can think of it as a single-threaded message queue if you will.
@ManishPatel30304 жыл бұрын
Cool video thanks 👌
@Shakenbeer4 жыл бұрын
Not really intuitive approach. Need time to get my head around. But in any case I need it to rid of RxJava and/or stop using LiveData in domain layer.