--

Another thing to note: asLiveData() by default stops the Flow collection after 5 seconds in the inactive state. If that Flow is a hot Flow produced with shareIn() or stateIn() with a SharingStarted.WhileSubscribed(5000) strategy, it will actually wait for an additional 5 seconds before stopping the upstream Flow, so in total the delay will be 10 seconds and not 5 seconds.

--

--

Christophe Beyls
Christophe Beyls

Written by Christophe Beyls

Android developer from Belgium, blogging about advanced programming topics.

No responses yet