Jason Inbody
08/10/2021, 12:40 AMJason Inbody
08/10/2021, 12:41 AMdarkmoon_uk
08/10/2021, 4:11 AMDisposableEffect
/ LaunchedEffect
). Even if you put this inside a ViewModel though you'd still need that ViewModel to be receiving lifecycle callbacks. A ViewModel after all is just a notional, organisation unit for your application code.
I would strongly recommend you to take that opportunity to layer your code with a logical ViewModel separate to the View though. Frankly speaking; I hate maintaining or dealing with applications where all the logic is written in-line with the View. They turn to spaghetti and/or blow-out in size very quickly.