You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm just trying out KMP and would like to know why this won't work on SwiftUI.
I tried to modify the sample code with an old-school ViewModel style:
private val _objects = MutableStateFlow(emptyList<MuseumObject>())
@NativeCoroutinesState
val objects: StateFlow<List<MuseumObject>> = _objects
fun fetchAll() {
viewModelScope.launch {
val data = museumRepository.museumApi.getData()
_objects.value = data
}
}
When calling fetchAll(), the code above works on Android, and the screen updates as expected. However, the screen doesn't update on SwiftUI.
I would really appreciate any guidance or suggestions you could provide. Thank you!
The text was updated successfully, but these errors were encountered:
Hi, I'm just trying out KMP and would like to know why this won't work on SwiftUI.
I tried to modify the sample code with an old-school ViewModel style:
When calling fetchAll(), the code above works on Android, and the screen updates as expected. However, the screen doesn't update on SwiftUI.
I would really appreciate any guidance or suggestions you could provide. Thank you!
The text was updated successfully, but these errors were encountered: