Convert flow from AC to livedata
parent
609462058b
commit
fc96e188ab
|
@ -7,6 +7,7 @@ package org.mozilla.fenix.components
|
|||
import android.content.Context
|
||||
import android.os.StrictMode
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.asLiveData
|
||||
import androidx.paging.DataSource
|
||||
import mozilla.components.browser.session.Session
|
||||
import mozilla.components.browser.session.SessionManager
|
||||
|
@ -71,7 +72,7 @@ class TabCollectionStorage(
|
|||
}
|
||||
|
||||
fun getCollections(limit: Int = 20): LiveData<List<TabCollection>> {
|
||||
return collectionStorage.getCollections(limit)
|
||||
return collectionStorage.getCollections(limit).asLiveData()
|
||||
}
|
||||
|
||||
fun getCollectionsPaged(): DataSource.Factory<Int, TabCollection> {
|
||||
|
|
|
@ -6,6 +6,7 @@ package org.mozilla.fenix.components
|
|||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.asLiveData
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
|
@ -41,7 +42,7 @@ class TopSiteStorage(private val context: Context) {
|
|||
* Returns a [LiveData] list of all the [TopSite] instances.
|
||||
*/
|
||||
fun getTopSites(): LiveData<List<TopSite>> {
|
||||
return storage.getTopSites()
|
||||
return storage.getTopSites().asLiveData()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue