-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: [:core:network] - Migrated to KMP (#1772)
* Feat: [:core:network] - Migrated to KMP * Feat: [:core:data] - Migrated to KMP Library
- Loading branch information
Showing
179 changed files
with
2,570 additions
and
4,890 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
16 changes: 16 additions & 0 deletions
16
core/common/src/commonMain/kotlin/org/mifospay/core/common/Result.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,16 @@ | ||
package org.mifospay.core.common | ||
|
||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.catch | ||
import kotlinx.coroutines.flow.map | ||
import kotlinx.coroutines.flow.onStart | ||
|
||
sealed interface Result<out T> { | ||
data class Success<T>(val data: T) : Result<T> | ||
data class Error(val exception: Throwable) : Result<Nothing> | ||
data object Loading : Result<Nothing> | ||
} | ||
|
||
fun <T> Flow<T>.asResult(): Flow<Result<T>> = map<T, Result<T>> { Result.Success(it) } | ||
.onStart { emit(Result.Loading) } | ||
.catch { emit(Result.Error(it)) } |
62 changes: 0 additions & 62 deletions
62
core/data/src/androidMain/java/org/mifospay/core/data/base/TaskLooper.kt
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
core/data/src/androidMain/java/org/mifospay/core/data/base/ThreadPoolQueue.kt
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
core/data/src/androidMain/java/org/mifospay/core/data/base/UseCase.kt
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
core/data/src/androidMain/java/org/mifospay/core/data/base/UseCaseFactory.kt
This file was deleted.
Oops, something went wrong.
65 changes: 0 additions & 65 deletions
65
core/data/src/androidMain/java/org/mifospay/core/data/base/UseCaseHandler.kt
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
core/data/src/androidMain/java/org/mifospay/core/data/base/UseCaseScheduler.kt
This file was deleted.
Oops, something went wrong.
59 changes: 0 additions & 59 deletions
59
core/data/src/androidMain/java/org/mifospay/core/data/base/UseCaseThreadPoolScheduler.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.