Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MainViewModel @Inject constructor() : ViewModel() {
- @Inject
- lateinit var repository: Repository
- private val loadUser: MutableLiveData<User> by lazy { MutableLiveData<User>() }
- val loadLiveUser: LiveData<User> by lazy { loadUser }
- fun load() {
- ioThread {
- loadUser.postValue(repository.load())
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement