launchIn

inline fun <T> Flow<T>.launchIn(owner: LifecycleOwner? = null, event: Lifecycle.Event = Lifecycle.Event.ON_DESTROY, dispatcher: CoroutineDispatcher = Dispatchers.Main, crossinline action: suspend CoroutineScope.(T) -> Unit): AndroidScope

Flow直接创建作用域

Parameters

owner

跟随的生命周期组件

event

销毁时机

dispatcher

指定调度器