https://github.com/kashif-e/the-mvvm-template-2022
Clean MVVM with eliminating the usage of context from view models by introducing hilt for DI and sealed classes for displaying Errors in views using shared flows (one time event), and Stateflow for data
https://github.com/kashif-e/the-mvvm-template-2022
android-application android-library flow kotlin kotlin-android kotlin-coroutines kotlin-flow kotlin-flow-paging mvvm mvvm-architecture mvvm-sample sealed-class sharedflow stateflow stateflow-demo stateflow-sample viewmodel viewmodels
Last synced: 8 months ago
JSON representation
Clean MVVM with eliminating the usage of context from view models by introducing hilt for DI and sealed classes for displaying Errors in views using shared flows (one time event), and Stateflow for data
- Host: GitHub
- URL: https://github.com/kashif-e/the-mvvm-template-2022
- Owner: Kashif-E
- Created: 2021-12-03T18:37:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-24T12:35:46.000Z (almost 4 years ago)
- Last Synced: 2025-03-28T01:26:18.520Z (about 1 year ago)
- Topics: android-application, android-library, flow, kotlin, kotlin-android, kotlin-coroutines, kotlin-flow, kotlin-flow-paging, mvvm, mvvm-architecture, mvvm-sample, sealed-class, sharedflow, stateflow, stateflow-demo, stateflow-sample, viewmodel, viewmodels
- Language: Kotlin
- Homepage:
- Size: 113 KB
- Stars: 24
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Clean ViewModel with Sealed Classes
Following are the purposes of this repo
1. Showing how you can remove the need of context in ViewModels.
I. By using dependency injection and providing dependencies outside of viewModel.
II. By using sealed classes to show error messages so you dont need context to get strings.
2. To show how you can clean you Activity/Fragment by not observing/collecting livedata/flow that are not needed to be
3. Basic MVVM with flow, stateflow, sharedflow
if this helps dont forget to star ⭐ ⭐ ⭐
Contact me on linkedin: [Kashif Mehmood](https://www.linkedin.com/in/kashif-mehmood-km/)