Skip to content

Commit

Permalink
Update project
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbel committed Nov 9, 2024
1 parent 7a27ef6 commit 1516b77
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/src/main/kotlin/org/michaelbel/template/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.koin.android.ext.koin.androidContext
import org.koin.androidx.viewmodel.dsl.viewModelOf
import org.koin.dsl.module
import org.michaelbel.template.datastore.AppPreferences
import org.michaelbel.template.repository.AppRepository

val appModule = module {
single<AppPreferences> {
Expand All @@ -15,5 +16,6 @@ val appModule = module {
)
AppPreferences(dataStore)
}
single<AppRepository> { AppRepository(get()) }
viewModelOf(::MainViewModel)
}
4 changes: 2 additions & 2 deletions app/src/main/kotlin/org/michaelbel/template/MainViewModel.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.michaelbel.template

import org.michaelbel.core.viewmodel.BaseViewModel
import org.michaelbel.template.datastore.AppPreferences
import org.michaelbel.template.repository.AppRepository

class MainViewModel(
private val appPreferences: AppPreferences
private val appRepository: AppRepository
): BaseViewModel()
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.michaelbel.template.repository

import org.michaelbel.template.datastore.AppPreferences

class AppRepository(
private val appPreferences: AppPreferences
)

0 comments on commit 1516b77

Please sign in to comment.