Skip to content
Permalink
Browse files

Remove unused LiveData

  • Loading branch information
zsmb13 committed Jan 7, 2020
1 parent 7385d6a commit 3916b47b211897d6f2658586d086ed3eb6051632
Showing with 1 addition and 4 deletions.
  1. +1 −4 app/src/main/java/dev/marcosfarias/pokedex/ui/pokedex/PokedexViewModel.kt
@@ -1,7 +1,6 @@
package dev.marcosfarias.pokedex.ui.pokedex

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import dev.marcosfarias.pokedex.App
import dev.marcosfarias.pokedex.database.dao.PokemonDAO
@@ -13,7 +12,6 @@ import retrofit2.Response

class PokedexViewModel : ViewModel() {

private var listPokemon = MutableLiveData<List<Pokemon>>()
private val pokemonDAO: PokemonDAO = App.database!!.pokemonDAO()

init {
@@ -34,12 +32,11 @@ class PokedexViewModel : ViewModel() {
pokemonDAO.add(pokemon)
}
}).start()
listPokemon.value = pokemons
}
}

override fun onFailure(call: Call<List<Pokemon>?>?, t: Throwable?) {
listPokemon.value = pokemonDAO.all().value
// TODO handle failure
}
})

0 comments on commit 3916b47

Please sign in to comment.
You can’t perform that action at this time.