bluelinelabs / Conductor

A small, yet full-featured framework that allows building View-based Android applications
Apache License 2.0
3.9k stars 343 forks source link

How do I get the viewLifecycleOwner when using Controller #647

Closed johnjeremih closed 3 years ago

johnjeremih commented 3 years ago

I'm trying to use the MVVM architecture, but I cannot get the "viewLifecycleOwner" when using the View model. How can I get viewLifecycleOwner using Controller?

viewModel.employee!!.observe(viewLifecycleOwner,{ mAdapter.notifyDataSetChanged() })

EricKuck commented 3 years ago

Sounds like you just need to add the conductor-archlifecycle module, which provides a ControllerLifecycleOwner. On Jun 21, 2021, 10:15 AM -0500, John De la Cruz @.***>, wrote:

I'm trying to use the MVVM architecture, but I cannot get the "viewLifecycleOwner" when using the View model. How can I get viewLifecycleOwner using Controller? viewModel.employee!!.observe(viewLifecycleOwner,{ mAdapter.notifyDataSetChanged() }) — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.