Newer
Older
ToDoApp / app / src / main / java / keijumt / todoapp / main / TasksViewModel.kt
KeijuMatsumoto on 9 Mar 2018 539 bytes [Add] task list
package keijumt.todoapp.main

import android.arch.lifecycle.LiveData
import keijumt.todoapp.BaseViewModel
import keijumt.todoapp.data.db.entity.Task
import keijumt.todoapp.data.repository.TaskRepository
import keijumt.todoapp.util.toLiveData
import javax.inject.Inject

/**
 * Task一覧のViewModel
 * Created by matsumoto_k on 2018/03/09.
 */
class TasksViewModel @Inject constructor(
        val repository: TaskRepository
) : BaseViewModel() {
    val tasks: LiveData<List<Task>> by lazy {
        repository.tasks.toLiveData()
    }
}