ViewModelGoodPractice
ViewModelGoodPractice copied to clipboard
This is an example repository to demonstrate the good practices of using ViewModel and how usage of AndroidViewModel can make things worst in a codebase
ViewModel Good Practices🦸♂️
This is a example repository to demonstrate the good practices of using ViewModel and how usage of AndroidViewModel can make things worst in a codebase.
This repository have both the implementation (good and bad).
📄 Read more about the approaches: https://blog.shreyaspatil.dev/dont-let-viewmodel-knew-about-framework-level-dependencies
👨💻 Implementation
- Branch
bad-implementation: Implementation usingAndroidViewModel. - Branch
refactor: Implementation usingViewModeland segregated logic.
If you are just interested in the ➕diff➖ of both the approaches then refer to this Pull Request
📱 What's this app about?
This is a simple app which demonstrates the user session management (login/logout actions).
https://user-images.githubusercontent.com/19620536/133656736-5dbaee16-cd44-4eb9-8ab1-3f7d97fdc1db.mp4