Let's say I have a call to `getUser(): Result<U...
# compose-desktop
c
Let's say I have a call to
getUser(): Result<User>
, what is the idiomatic way of displaying that in the UI? Before error handling was necessary, I had something like:
val (user, setUser) = remember { mutableStateOf<User?>(null) }
Copy code
Button(onClick = { scope.launch { setUser(getUser()) } })

if (user != null)
  // display the user
But now that there's a Result in the way, I'm unsure what would be the “compose way” of doing things.
d
Errors should be part of your state I think.