``` class MainViewModel @Inject constructor(privat...
# codereview
s
Copy code
class MainViewModel @Inject constructor(private val movieRepository: MovieRepository) : ViewModel() {

    private val movieList: LiveData<List<MovieEntry>> = movieRepository.getMovies()

    fun getMovies(): LiveData<List<MovieEntry>> = movieList
}
Copy code
class MainViewModel @Inject constructor(private val movieRepository: MovieRepository) : ViewModel() {

    fun getMovies(): LiveData<List<MovieEntry>> = movieRepository.getMovies()
}
Copy code
class MainViewModel @Inject constructor(private movieRepository: MovieRepository) : ViewModel() {

    init {
         fun getMovies(): LiveData<List<MovieEntry>> = movieRepository.getMovies()
    }
}
Which of these versions is better and if there's another syntax that might be better?