Remember flows (#4533)
* Add Konsist test to ensure that the result of a function returning a flow is remembered. * Remember flows before they are collected by state. * Fix compilation issue * Make isOnline a val. * Make selectedUsers() a val. * Make flow() a val. * Make getUserConsent(), didAskUserConsent() and getAnalyticsId() some val. * Remove Timeline.paginationStatus() and replace by direct access to the underlined flow. * Simplify test * userConsentFlow must be initialized before because it's used in observeUserConsent * Fix test compilation
This commit is contained in:
parent
e557ee2c77
commit
a230b83e99
52 changed files with 221 additions and 172 deletions
|
|
@ -34,7 +34,9 @@ class SignedOutPresenter @AssistedInject constructor(
|
|||
|
||||
@Composable
|
||||
override fun present(): SignedOutState {
|
||||
val sessions by sessionStore.sessionsFlow().collectAsState(initial = emptyList())
|
||||
val sessions by remember {
|
||||
sessionStore.sessionsFlow()
|
||||
}.collectAsState(initial = emptyList())
|
||||
val signedOutSession by remember {
|
||||
derivedStateOf { sessions.firstOrNull { it.userId == sessionId } }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue