How to cancel/unsubscribe from coroutines Flow

前端 未结 3 1123
既然无缘
既然无缘 2021-02-14 03:23

I notice a strange behavior when trying to prematurely cancel from a Flow. Take a look at the following example.

This is a simple flow that emits integer values

3条回答
  •  梦如初夏
    2021-02-14 03:38

    I want to add that in 1.3.7 version emissions from flow builder now check cancellation status and are properly cancellable. So the code in question will work as expected

提交回复
热议问题