Hi, What is the best equivalent to remove RxJava f...
# getting-started
a
Hi, What is the best equivalent to remove RxJava from the existing Android project? I am using StateFlow to replace the BehaviorSubject and SharedFlow to replace the PublishSubject. Unfortunately, the sequence emits are not working as expected.
c
Explain what exactly is not working as expected in #flow 🙂
a
If List values are updated, It's not updating in collectLatest for StateFlow
c
You'll need to provide more information than that, like a small example
p
One difference between Rx and Flow, and this might he what you are seeing -
Note that any instance of StateFlow already behaves as if
distinctUntilChanged
operator is applied to it, so applying
distinctUntilChanged
to a
StateFlow
has no effect. See StateFlow documentation on Operator Fusion. Also, repeated application of
distinctUntilChanged
operator on any flow has no effect.
(from https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/distinct-until-changed.html )