Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class PostListViewModel : ViewModel() {
private val repo: PostRepository by inject()
fun getNewPostList(): Observable<List<NewPost>> {
return repo.getNewPostList()
class PostListFragment : Fragment {
private val viewModel by viewModel<PostListViewModel>()
override fun onViewCreated() {
.subscribe {
// update list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment