After 5 seconds of no active observers for NewsArticleViewModel.newsArticles (device locked) and NewsActivity re-observe the newsArticles (device unlocked), NetworkBoundResource.asFlow() is called again.
If I change the emitAll(loadFromDb().map { ViewState.success(it) }) into emit(loadFromDb().map { ViewState.success(it) }.first()), NetworkBoundResource.asFlow() is not called.
After 5 seconds of no active observers for
NewsArticleViewModel.newsArticles
(device locked) andNewsActivity
re-observe thenewsArticles
(device unlocked),NetworkBoundResource.asFlow()
is called again.If I change the
emitAll(loadFromDb().map { ViewState.success(it) })
intoemit(loadFromDb().map { ViewState.success(it) }.first())
,NetworkBoundResource.asFlow()
is not called.