【问题标题】:How to transform Flow<List<T>> to Flow<T> in Kotlin?如何在 Kotlin 中将 Flow<List<T>> 转换为 Flow<T>?
【发布时间】:2021-11-02 14:20:14
【问题描述】:

我得到一个Flow&lt;List&lt;T&gt;&gt; 类型的流,我需要从中得到一个Flow&lt;T&gt; 类型的流。

我试过了:

outerFlow.onEach { items -> items.onEach { flow { emit(it) } }

这不起作用。我怎样才能做到这一点?

【问题讨论】:

    标签: kotlin flow


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 2021-12-29
    • 1970-01-01
    • 2021-10-02
    • 1970-01-01
    • 2021-07-14
    • 2022-01-09
    • 1970-01-01
    • 2014-02-05
    相关资源
    最近更新 更多