After this lesson you will
- Declare ViewModels with viewModelOf or viewModel { } and know when you need the lambda
- Use androidx.lifecycle.ViewModel in commonMain for Android and iOS
- Explain ViewModelStoreOwner and the ViewModel lifecycle tied to the back stack entry
Duration25 min
DifficultyIntermediate
Koin ViewModel Scope
Koin ViewModel Scope in the Mobile Action Pro course.
- 01Lesson Goal
- 02Part 1: ViewModels In commonMain
- 03Part 2: viewModelOf
- 04Part 3: The viewModel Lambda When You Create A Parameter Yourself
- 05Part 4: Who Holds The Instance
- 06Part 5: Designing Around That Lifecycle
- 07Practice Exercise
- 08Code Reading Path
- 09Signs To Avoid
- 10References
- 11Key Points
Topics: kotlin, 07-dependency-injection
11 sections left in this lessonUnlock all of Mobile Action ProLesson Goal, Part 1: ViewModels In commonMain, … — plus 114 lessons in this course, source code and checklists.
Unlock Mobile Action ProOne-time payment — lifetime access — 7-day money-back. Already purchased? Sign in