then I am doing some computation logic inside my this function. Inide that I have data coming from server of all three class data.
fun calculateData(){
val list = comingFromServer()
list.forEach{ shape->
shape.circle?.let{
// adding data
}
shape.rectangle?.let{
// adding data
}
shape.triangle?.let{
// adding data
}
}
}
I have few points in which I want your suggestion and best approach.
I want to notify my view that my code is go inside the
let of
shape.circle?
and
shape.rectangle?
or not . Also I want to notify my view that my code inside
shape.triangle?
. My List is this type of type of coming from server
List(CircleData, RectangleData, TriangleData)
or
List(CircleDataNull, RectangleDataNull, TriangleData)
I want to know, how can I to notify my view in best approach. What would you suugest to use
MutableLiveData,
MutableStateFlow or
MutableSharedFlow. Please give me example which one is best. Thanks