How do I convert this to a lambda? ```viewModel.ge...
# android
b
How do I convert this to a lambda?
Copy code
viewModel.getClasses().observe(this, object : Observer<MutableList<Classes>> {
            override fun onChanged(classes: MutableList<Classes>?) {

            }
        })
Kotlin is yelling at me about the
object : Observer<MutableList<Classes>>
part Is this the same as the previous?
Copy code
viewModel.getClasses().observe(this, Observer<MutableList<Classes>> {
            it?.let { classAdapter.notifyDataSetChanged() }
        })
i
blakelee: you can check this sample https://github.com/KucherenkoIhor/Android-Architecture-Components and find answer in ReposActivity
👍🏼 1
b
I was already trying to follow this haha. Thanks for it
Dude... I just got that example working. It just saved me a ton of code. Thanks!
i
blakelee: urw