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
Make the Store expose a StateFlow instead of a Flow so it's easier to use in Compose. With StateFlow we can just use collectAsState() without providing an initial value and reducing recompositions.
The text was updated successfully, but these errors were encountered:
When the mapToLocalState lambda returns an optional, there is no good way (?) to provide a non-optional initial value for a stateIn() function. For example from MutableStateFlowStore the required mapToLocalState(state.value)!! would cause crashes when the mapToLocalState lambda returns null.
What sveltema said above is the reason we didn't implement this change while I was at toggl. We couldn't agree on what the API for optionalView should look like 🤔
Description
Make the
Store
expose aStateFlow
instead of aFlow
so it's easier to use in Compose. WithStateFlow
we can just usecollectAsState()
without providing an initial value and reducing recompositions.The text was updated successfully, but these errors were encountered: