xxfast
05/09/2022, 1:22 AMmutableStateFlow.value = newValue
mutableStateFlow.emit(newValue)
ephemient
05/09/2022, 1:34 AMMutableSharedFlow
does not have value
, which is why emit()
exists. but for MutableStateFlow
the two have the same behavior. note that StateFlow
will coalesce emissions regardless of which method you useNandu
05/09/2022, 6:41 AMephemient
05/09/2022, 6:54 AMMutableStateFlow.emit()
is exactly value =
. as in the question, they are identical aside from the suspend
declaration (and because it doesn't contain any suspend points, there is no coroutine state machine involved)