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
The current SharedFlow<T>.onSubscription implementation returns a SharedFlow<T>, which means losing type information when calling it from a StateFlow<T>. It would be nice to have a StateFlow<T>.onSubscription counterpart for StateFlow<T>, thus avoiding the aforementioned issue.
The Shape of the API
Unless there are implementation details I'm unaware of, the API could be copy-pasted from the SharedFlow<T>.onSubscription implementation and adapted to work with StateFlow<T>:
Use case
The current
SharedFlow<T>.onSubscription
implementation returns aSharedFlow<T>
, which means losing type information when calling it from aStateFlow<T>
. It would be nice to have aStateFlow<T>.onSubscription
counterpart forStateFlow<T>
, thus avoiding the aforementioned issue.The Shape of the API
Unless there are implementation details I'm unaware of, the API could be copy-pasted from the
SharedFlow<T>.onSubscription
implementation and adapted to work withStateFlow<T>
:Prior Art
The text was updated successfully, but these errors were encountered: