ursus
10/24/2020, 1:54 PMObservable.just(1).startWith(0)
emits 0,1
flow
flowOf(1).onStart { emit(0) }
emits 1,0
is this by design? a rx fix? pretty foot gunny when mkgrating
also, what if the actual flow is replayed? if its "below" the onStart, id assume it emits first which is not goodgildor
10/24/2020, 2:47 PMjw
10/24/2020, 2:51 PMgildor
10/24/2020, 2:54 PMursus
10/24/2020, 4:37 PMflowOf("a", "b", "c")
.onStart { emit("Begin") }
.collect { println(it) } // prints Begin, a, b, c
I must be doing something wrong thenrepository.foo()
.asFlow()
.map<Foo, Signal<Foo>> { Success(it) }
.catch { emit(Fail(it)) }
.onStart { emit(Loading) }
.collect {
Log.d("Default", "foo=$it")
setState { copy(fooSignal = it) }
}
2020-10-24 19:30:06.870 30453-30501/sk.foo.flowplayground D/Default: foo=sk.foo.flowplayground.Loading@f0b3a3c
2020-10-24 19:30:06.872 30453-30501/sk.foo.flowplayground D/Default: foo=Success(value=Foo(foo=1))
2020-10-24 19:30:06.872 30453-30501/sk.foo.flowplayground D/Default: foo=Success(value=Foo(foo=1))
nevermind
florent
10/24/2020, 10:55 PMursus
10/24/2020, 10:58 PM