Hi there, I am looking to apply a computationally ...
# getting-started
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
e
return@transform
will exit the lambda expression early
❤️ 1
m
Thank you!