Coder Social home page Coder Social logo

daniaviladomingo / kmm Goto Github PK

View Code? Open in Web Editor NEW
170.0 170.0 14.0 8.46 MB

Rick & Morty Kotlin/Compose Multiplatform: Ktor, Sqldelight, Koin, Flow, MVI, Compose

Kotlin 92.10% Swift 0.86% Ruby 2.70% HTML 0.42% Batchfile 3.92%
android clean-architecture compose compose-multiplatform coroutines desktop jetpack-compose kmm kmp koin kotlin kotlin-mobile-multiplatform kotlin-mpp kotlin-multiplatform kotlin-multiplatform-mobile ktor mvi sqldelight

kmm's People

Contributors

daniaviladomingo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kmm's Issues

why usecase are using flow()

I want to thank you first,
then I hope you answer my question, it is a question, not an issue ๐Ÿ˜ƒ

All ApiService methods are returning suspend functions
operator fun invoke(param: IN): Flow<Resource> = flow {
why are UseCaseIn methods converted to flowOf ()
e.g

abstract class UseCaseIn<IN> {
    operator fun invoke(param: IN): Flow<Resource<Unit>> = flow {
        emit(
            try {
                Resource.Success(block(param))
            } catch (ex: Exception) {
                Resource.Error(exception = ex)
            }
        )
    }
    protected abstract val block: suspend (param: IN) -> Unit
}

what are the benefits of making all repo methods in kotlin flow,
where consuming suspend fun is easier than flow?
also combing two suspend funs is much easier to combine two flows to create new use cases.

I see this pattern I would like to know the secret behind ๐Ÿ˜Ž

Cross module dependency resolution failed due to signature

I get this when I run the web app:

java.lang.IllegalArgumentException: Cross module dependency resolution failed due to signature 'org.w3c.dom.events/EventListener|2833721539368120484[0]' redefinition
	at org.jetbrains.kotlin.ir.backend.js.transformers.irToJs

what is the difference?

Hello again,
I almost study each GitHub KMM sample your's is the best.
I have a question if you plz.

private val _event: MutableSharedFlow<Event> = MutableSharedFlow()
  val event = _event.asSharedFlow()

  private val _effect: Channel<Effect> = Channel()
  val effect = _effect.receiveAsFlow()

what is the clear difference between effects and events?
and why events are MutableSharedFlow where _effect is Channel

Suggestion: Use ViewModel for Android platform

Hey,

I really like what you have done here. I'm new to KMM and have taken some inspiration from this project. Unless I'm misunderstanding a few things (Never used Koin before), this shared "BaseViewModel" doesn't survive config changes. I.e. it's making network requests upon rotation, lanugage changes and light/dark mode.

I had a little play with it and managed to let it survive config changes by introduction Android ViewModel on the android platform side by adding:

expect open class OSViewModel() in commonMain
`import androidx.lifecycle.ViewModel

actual open class OSViewModel : ViewModel() in androidMain

actual open class OSViewModel in iOSMain

androidx.lifecycle:lifecycle-viewmodel-ktx depedency in the build.gradle.kts::shared androidMain

private val vm: HomeViewModel by viewModels() in the activities instead of Koin inject()

abstract class MainIoExecutor : OSViewModel() in commonMain IOExecutor

By doing this, the Viewmodel is still shared, but on the Android platform, it takes the logic of the Android ViewModel to survive config changes. Again, this might not be necessary as I have misunderstood something but it seems to work nicely on my project.

iOS build failed

Hello, thanks for sharing your project!

I just did a try to build it ad see some issues with that. For Android everything works perfectly. But for iOS I have some issues with that. Actually I am an Android developer so maybe I am missing something. This is what I have:

image

Seems like in my iOS project it does not see the shared module. Maybe I miss some command for linking the module to the iOS?

Thanks in advanced.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.