i tried onStart but obviously, it still is debounc...
# coroutines
m
i tried onStart but obviously, it still is debounced
v
even if the onStart is applied on the debounced flow?
i.e
flow.debounce().onStart{}
m
yes
it doesn't work like rxjava 😛 that was my assumption. and it doesn't
v
Copy code
runBlockingTest {
        val input = BroadcastChannel<Int>(1)
        val flow = input.asFlow().debounce(1000).onStart { emit(100) }

        val results = mutableListOf<Int>()
        launch{
            flow.collect { results.add(it) }
        }

        input.offer(1)

        assertThat(results).isEqualTo(listOf(100))

        advanceTimeBy(1000)
        assertThat(results).isEqualTo(listOf(100, 1))
}
This test is passing. Am I missing something?
m
yes, you right it is working
maybe i placed onStart in the wrong place, idk. gona check it better and let u know
thanks
👍 1