After this lesson you will
- Get a ViewModel in a route with koinViewModel and assign it to an interface-typed variable
- Use koinInject for platform seams and config in the UI, keeping the Screen unaware of Koin
- Correctly predict a ViewModel's owner in a destination and in a popup
Duration25 min
DifficultyIntermediate
ViewModel Injection In Routes
ViewModel Injection in Routes in the Mobile Action Pro course.
- 01Lesson Goal
- 02Part 1: The Route Is The Boundary Between Koin And UI
- 03Part 2: Declaring An Interface Type
- 04Part 3: koinInject For Things That Aren't ViewModels
- 05Part 4: The Owner Of A Route And Of A Popup
- 06Part 5: Navigation Callbacks Go Into The Route
- 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: The Route Is The Boundary Between Koin And UI, … — 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