Giter VIP home page Giter VIP logo

Comments (1)

dbaroncelli avatar dbaroncelli commented on June 4, 2024

Hi Adrien,

In terms of Navigation:
I haven't implemented a use case where login is involved, however thinking about it, this is probably how I would structure it:

  • I would define a Login screen, like any other, with its own state and its own events.
  • Inside the "callOnInit" function of any Screen requiring authentication, I would include the logic that if the user isn't authenticated (you could keep a flag about it, in the NavigationSettings.kt), it would redirect to the Login screen.
    At the moment, in terms of screen's lifecycle, I have just defined "callOnInit", which is executed each time the app navigates to that screen. I haven't defined anything like "callOnDisappear", as I haven't found a use case for that yet.
    Generally speaking, I would keep actions separated by the UI definition. E.g. I would tend to avoid stuff like LaunchedEffect, as it makes testing more difficult. Better to define actions/events (and any concurrency involved) in the shared code.

In terms of GraphQL:
I think the architecture perfectly fits. You just need to create a new property in the Repository.kt file, calling it for example graphQL. And then define any GraphQL related code inside the "sources/graphQL" directory, similarly to any other source.

In terms of packaging D-KMP files as a multiplatform library:
It might happen eventually, but at the moment the project is still at an early stage, so I prefer to keep the code "in the open", as it's easier to debug and spot any issue.

I hope I was able to give some clarifications.
If you have any other questions, feel free to ask.

from d-kmp-sample.

Related Issues (20)

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.