GithubHelp home page GithubHelp logo

zahraheydari / android-clean-arch-coroutines-koin Goto Github PK

View Code? Open in Web Editor NEW
268.0 10.0 44.0 367 KB

Implemented by Clean Architecture, MVVM, Koin, Coroutines, Moshi, Mockk, LiveData & DataBinding

Kotlin 100.00%
kotlin-android mvvm-pattern livedata databinding clean-architecture retrofit2-kotlin livedata-databinding coroutines coroutines-android koin

android-clean-arch-coroutines-koin's People

Contributors

georgcantor avatar zahraheydari 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-clean-arch-coroutines-koin's Issues

Can use cases contain models from the data package?

Hi Zara, thanks for the nice sample. I do have one question.

Can GetPostsUseCase contain Post and ApiErrorHandle from the data package? I thought that something like that was prohibited by clean architecture principles as domain should not depend on anything else.

Is there maybe an exception for this case?

Regards,
Thanos

Error handling not working

When an API exception is happening the exception should be caught in catch block is it?

fun invoke( scope: CoroutineScope, params: Params?, onResult: (UseCaseResponse<Type>) ) { val backgroundJob = scope.async { run(params) } scope.launch { backgroundJob.await().let { try { Log.e("UseCase", "Success") onResult.onSuccess(it) } catch (e: Exception) { Log.e("UseCase", "Exception") onResult.onError(apiErrorHandle?.traceErrorException(e)) } } } }

But this is not happening. Am I missing anything?

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.