Forgive noob question, but coming from Rx backgrou...
# flow
d
Forgive noob question, but coming from Rx background this tends to be a big issue… If I assign a
SharedFlow
or
StateFlow
initialized from a cold
Flow
(with
stateIn(...Eagerly...)
) to a
var
, but then later assign
null
to the `var`; once there are no subscribers left to the
SharedFlow
(and no references left to it) will it cancel the original cold
Flow
(and otherwise free its resources)?
b
No, if you need Rx's
refCount
equivalent, use
SharingStarted.WhileSubscribed()
. Otherwise original cold flow will be cancelled once scope (passed to stateIn/shareIn) gets cancelled
🙏 1