Last active
February 12, 2019 14:16
-
-
Save PhilippeBoisney/94ad9b34302990fb6dddf3ce932a8a9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserDataSourceFactory(private val repository: UserRepository, | |
private var query: String = "", | |
private var sort: String = "", | |
private val scope: CoroutineScope): DataSource.Factory<Int, User>() { | |
val source = MutableLiveData<UserDataSource>() | |
override fun create(): DataSource<Int, User> { | |
val source = UserDataSource(repository, query, sort, scope) | |
this.source.postValue(source) | |
return source | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment