combineTransform
Returns a Flow whose values are generated by transform function that process the most recently emitted values by each flow.
The receiver of the transform is FlowCollector and thus transform
is a generic function that may transform emitted element, skip it or emit it multiple times.
Its usage can be demonstrated with the following example:
val flow = requestFlow()
val flow2 = searchEngineFlow()
flow.combineTransform(flow2) { request, searchEngine ->
emit("Downloading in progress")
val result = download(request, searchEngine)
emit(result)
}
Returns a Flow whose values are generated by transform function that process the most recently emitted values by each flow.
The receiver of the transform is FlowCollector and thus transform
is a generic function that may transform emitted element, skip it or emit it multiple times.
Its usage can be demonstrated with the following example:
val flow = requestFlow()
val flow2 = searchEngineFlow()
combineTransform(flow, flow2) { request, searchEngine ->
emit("Downloading in progress")
val result = download(request, searchEngine)
emit(result)
}
Returns a Flow whose values are generated by transform function that process the most recently emitted values by each flow.
The receiver of the transform is FlowCollector and thus transform
is a generic function that may transform emitted element, skip it or emit it multiple times.