-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab72fc8
commit 5092887
Showing
38 changed files
with
379 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...n/src/androidMain/kotlin/org/michaelbel/movies/common/dispatchers/IoDispatcher.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.michaelbel.movies.common.dispatchers | ||
|
||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
internal actual val ioDispatcher: CoroutineDispatcher = Dispatchers.IO |
5 changes: 5 additions & 0 deletions
5
core/common/src/commonMain/kotlin/org/michaelbel/movies/common/dispatchers/IoDispatcher.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.michaelbel.movies.common.dispatchers | ||
|
||
import kotlinx.coroutines.CoroutineDispatcher | ||
|
||
internal expect val ioDispatcher: CoroutineDispatcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
core/common/src/iosMain/kotlin/org/michaelbel/movies/common/dispatchers/IoDispatcher.ios.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.michaelbel.movies.common.dispatchers | ||
|
||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
internal actual val ioDispatcher: CoroutineDispatcher = Dispatchers.Default |
5 changes: 5 additions & 0 deletions
5
core/common/src/jsMain/kotlin/org/michaelbel/movies/common/browser/Browser.js.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.michaelbel.movies.common.browser | ||
|
||
fun openUrl(url: String) { | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
core/common/src/jsMain/kotlin/org/michaelbel/movies/common/dispatchers/IoDispatcher.js.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.michaelbel.movies.common.dispatchers | ||
|
||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
internal actual val ioDispatcher: CoroutineDispatcher = Dispatchers.Default |
6 changes: 6 additions & 0 deletions
6
core/common/src/jsMain/kotlin/org/michaelbel/movies/common/dispatchers/UiDispatcher.js.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.michaelbel.movies.common.dispatchers | ||
|
||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
internal actual val uiDispatcher: CoroutineDispatcher = Dispatchers.Default |
5 changes: 5 additions & 0 deletions
5
core/common/src/jsMain/kotlin/org/michaelbel/movies/common/ktx/SavedStateHandleKtx.js.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.michaelbel.movies.common.ktx | ||
|
||
import androidx.lifecycle.SavedStateHandle | ||
|
||
fun <T> SavedStateHandle.require(key: String): T = requireNotNull(this[key]) |
3 changes: 3 additions & 0 deletions
3
core/common/src/jsMain/kotlin/org/michaelbel/movies/common/log/Logger.js.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package org.michaelbel.movies.common.log | ||
|
||
actual fun log(throwable: Throwable) {} |
18 changes: 18 additions & 0 deletions
18
core/common/src/jsMain/kotlin/org/michaelbel/movies/common/viewmodel/BaseViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.michaelbel.movies.common.viewmodel | ||
|
||
import androidx.annotation.CallSuper | ||
import androidx.lifecycle.ViewModel | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.SupervisorJob | ||
import org.michaelbel.movies.common.dispatchers.uiDispatcher | ||
import org.michaelbel.movies.common.log.log | ||
|
||
open class BaseViewModel: ViewModel( | ||
viewModelScope = CoroutineScope(uiDispatcher + SupervisorJob()) | ||
) { | ||
|
||
@CallSuper | ||
protected open fun handleError(throwable: Throwable) { | ||
log(throwable) | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...ommon/src/jvmMain/kotlin/org/michaelbel/movies/common/dispatchers/IoDispatcher.desktop.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.michaelbel.movies.common.dispatchers | ||
|
||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
internal actual val ioDispatcher: CoroutineDispatcher = Dispatchers.IO |
5 changes: 5 additions & 0 deletions
5
core/common/src/wasmJsMain/kotlin/org/michaelbel/movies/common/browser/Browser.wasm.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.michaelbel.movies.common.browser | ||
|
||
fun openUrl(url: String) { | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
...ommon/src/wasmJsMain/kotlin/org/michaelbel/movies/common/dispatchers/IoDispatcher.wasm.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.michaelbel.movies.common.dispatchers | ||
|
||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
internal actual val ioDispatcher: CoroutineDispatcher = Dispatchers.Default |
6 changes: 6 additions & 0 deletions
6
...ommon/src/wasmJsMain/kotlin/org/michaelbel/movies/common/dispatchers/UiDispatcher.wasm.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.michaelbel.movies.common.dispatchers | ||
|
||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
internal actual val uiDispatcher: CoroutineDispatcher = Dispatchers.Default |
5 changes: 5 additions & 0 deletions
5
...common/src/wasmJsMain/kotlin/org/michaelbel/movies/common/ktx/SavedStateHandleKtx.wasm.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.michaelbel.movies.common.ktx | ||
|
||
import androidx.lifecycle.SavedStateHandle | ||
|
||
fun <T> SavedStateHandle.require(key: String): T = requireNotNull(this[key]) |
3 changes: 3 additions & 0 deletions
3
core/common/src/wasmJsMain/kotlin/org/michaelbel/movies/common/log/Logger.wasm.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package org.michaelbel.movies.common.log | ||
|
||
actual fun log(throwable: Throwable) {} |
18 changes: 18 additions & 0 deletions
18
core/common/src/wasmJsMain/kotlin/org/michaelbel/movies/common/viewmodel/BaseViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.michaelbel.movies.common.viewmodel | ||
|
||
import androidx.annotation.CallSuper | ||
import androidx.lifecycle.ViewModel | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.SupervisorJob | ||
import org.michaelbel.movies.common.dispatchers.uiDispatcher | ||
import org.michaelbel.movies.common.log.log | ||
|
||
open class BaseViewModel: ViewModel( | ||
viewModelScope = CoroutineScope(uiDispatcher + SupervisorJob()) | ||
) { | ||
|
||
@CallSuper | ||
protected open fun handleError(throwable: Throwable) { | ||
log(throwable) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...s/src/jsMain/kotlin/org/michaelbel/movies/platform/impl/analytics/AnalyticsServiceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") | ||
|
||
package org.michaelbel.movies.platform.impl.analytics | ||
|
||
import org.michaelbel.movies.platform.analytics.AnalyticsService | ||
|
||
actual class AnalyticsServiceImpl: AnalyticsService { | ||
|
||
override val screenView: String = "" | ||
|
||
override val screenName: String = "" | ||
|
||
override fun logEvent(name: String, params: HashMap<String, String>) {} | ||
} |
7 changes: 7 additions & 0 deletions
7
...es/foss/src/jsMain/kotlin/org/michaelbel/movies/platform/impl/review/ReviewServiceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") | ||
|
||
package org.michaelbel.movies.platform.impl.review | ||
|
||
import org.michaelbel.movies.platform.review.ReviewService | ||
|
||
actual class ReviewServiceImpl: ReviewService |
7 changes: 7 additions & 0 deletions
7
...es/foss/src/jsMain/kotlin/org/michaelbel/movies/platform/impl/update/UpdateServiceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") | ||
|
||
package org.michaelbel.movies.platform.impl.update | ||
|
||
import org.michaelbel.movies.platform.update.UpdateService | ||
|
||
actual class UpdateServiceImpl: UpdateService |
14 changes: 14 additions & 0 deletions
14
...c/wasmJsMain/kotlin/org/michaelbel/movies/platform/impl/analytics/AnalyticsServiceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") | ||
|
||
package org.michaelbel.movies.platform.impl.analytics | ||
|
||
import org.michaelbel.movies.platform.analytics.AnalyticsService | ||
|
||
actual class AnalyticsServiceImpl: AnalyticsService { | ||
|
||
override val screenView: String = "" | ||
|
||
override val screenName: String = "" | ||
|
||
override fun logEvent(name: String, params: HashMap<String, String>) {} | ||
} |
7 changes: 7 additions & 0 deletions
7
...oss/src/wasmJsMain/kotlin/org/michaelbel/movies/platform/impl/review/ReviewServiceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") | ||
|
||
package org.michaelbel.movies.platform.impl.review | ||
|
||
import org.michaelbel.movies.platform.review.ReviewService | ||
|
||
actual class ReviewServiceImpl: ReviewService |
7 changes: 7 additions & 0 deletions
7
...oss/src/wasmJsMain/kotlin/org/michaelbel/movies/platform/impl/update/UpdateServiceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") | ||
|
||
package org.michaelbel.movies.platform.impl.update | ||
|
||
import org.michaelbel.movies.platform.update.UpdateService | ||
|
||
actual class UpdateServiceImpl: UpdateService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@file:OptIn(ExperimentalWasmDsl::class) | ||
|
||
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl | ||
|
||
plugins { | ||
alias(libs.plugins.kotlin.multiplatform) | ||
} | ||
|
||
kotlin { | ||
js { | ||
moduleName = "composeApp" | ||
browser { | ||
commonWebpackConfig { | ||
outputFileName = "composeApp.js" | ||
} | ||
} | ||
binaries.executable() | ||
} | ||
wasmJs { | ||
moduleName = "composeApp" | ||
browser { | ||
commonWebpackConfig { | ||
outputFileName = "composeApp.js" | ||
} | ||
} | ||
binaries.executable() | ||
} | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
implementation(project(":core:platform-services:foss")) | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...rc/commonMain/kotlin/org/michaelbel/movies/platform/inject/FlavorServiceKtorModule.web.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.michaelbel.movies.platform.inject | ||
|
||
import org.koin.core.module.dsl.bind | ||
import org.koin.core.module.dsl.singleOf | ||
import org.koin.dsl.module | ||
import org.michaelbel.movies.platform.analytics.AnalyticsService | ||
import org.michaelbel.movies.platform.app.AppService | ||
import org.michaelbel.movies.platform.config.ConfigService | ||
import org.michaelbel.movies.platform.crashlytics.CrashlyticsService | ||
import org.michaelbel.movies.platform.impl.analytics.AnalyticsServiceImpl | ||
import org.michaelbel.movies.platform.impl.app.AppServiceImpl | ||
import org.michaelbel.movies.platform.impl.config.ConfigServiceImpl | ||
import org.michaelbel.movies.platform.impl.crashlytics.CrashlyticsServiceImpl | ||
import org.michaelbel.movies.platform.impl.messaging.MessagingServiceImpl | ||
import org.michaelbel.movies.platform.impl.platformKoinModule | ||
import org.michaelbel.movies.platform.impl.review.ReviewServiceImpl | ||
import org.michaelbel.movies.platform.impl.update.UpdateServiceImpl | ||
import org.michaelbel.movies.platform.messaging.MessagingService | ||
import org.michaelbel.movies.platform.review.ReviewService | ||
import org.michaelbel.movies.platform.update.UpdateService | ||
|
||
val flavorServiceKtorModule = module { | ||
includes( | ||
platformKoinModule | ||
) | ||
singleOf(::AnalyticsServiceImpl) { bind<AnalyticsService>() } | ||
singleOf(::AppServiceImpl) { bind<AppService>() } | ||
singleOf(::ConfigServiceImpl) { bind<ConfigService>() } | ||
singleOf(::CrashlyticsServiceImpl) { bind<CrashlyticsService>() } | ||
singleOf(::MessagingServiceImpl) { bind<MessagingService>() } | ||
singleOf(::ReviewServiceImpl) { bind<ReviewService>() } | ||
singleOf(::UpdateServiceImpl) { bind<UpdateService>() } | ||
} |
Oops, something went wrong.