hi guys how can I use the ViewModel binding to bin...
# moko
j
hi guys how can I use the ViewModel binding to bind Custom Objects I have an object
DataState
and trying to bind it on swiftui just like a String, boolean, etc.
Copy code
val countryCatalogue = MutableStateFlow(DataState<Catalogue>()).cMutableStateFlow()
My DataSate has an object
data
, an object
error
and
enum
that has the status of the Data (loading, success, error) and I want to show an error view when the DataSate gets an error or progressview when is loading
Copy code
}.overlay() {
            if (isLoading ) {. // //viewModel.binding(\.countryCatalogue).status == .loading 
                ProgressDialog()
            }
            if (isError) { // //viewModel.binding(\.countryCatalogue).status == .error 
                AlertMessage(error: uiError,
                             onClickActions: { button in
                    uiError.isShown.toggle()
                })
            }
            
        }