Hi there, I am looking to apply a computationally ...
# coroutines
m
Hi there, I am looking to apply a computationally expensive transformation to items in a flow, emitting intermediate signals indicating the progress of this transformation. (Emitting multiple times from .transform). If certain error conditions are met during this transformation, I want to skip the rest of the function being applied, and move onto the next item in the flow.
someFlow.transform {
if (someCondition) {
emit(Resource.Loading(someIntermediateResult))
} else {
emit(Resource.Error("Couldn't compute")
//Want to place something here to skip code below and move to next item in flow
}
emit(Resource.Success(finalResult)
Any ideas? Feel like I am missing something simple Thanks, Michael Slack Conversation
b
Copy code
} else {
    emit(Resource.Error("Couldn't compute")
    return@transform
}
// code below
❤️ 1
m
Thank you! Will have a go