Comments (1)
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 likeLaunchedEffect
, 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)
- Is there any way to achieve Android navigation transitions in this project? HOT 1
- Navigation appears to be broken on iOS HOT 7
- Error SockeTimeout when building `shared:runCommonizer` task HOT 5
- Yup
- Some doubts HOT 2
- Could not initialize class org.jetbrains.kotlin.com.intellij.pom.java.LanguageLevel HOT 1
- First run not working HOT 1
- slowness in opening the project HOT 1
- Could not resolve ktor-client-js HOT 1
- the architecture of D-KMP may be too complex? HOT 2
- Bad Gateway trying to get compose runtime HOT 2
- Result from other view/state HOT 1
- Ios could not see getIosInstance() HOT 2
- "Jvm target compatibility should be set to the same Java version" build error HOT 1
- only one AppState may make performance issue? HOT 2
- FAILURE: Build failed with an exception. HOT 4
- App not working for android < 26. HOT 5
- iOS Native App HOT 10
- [Deprecated] Remove jcenter HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d-kmp-sample.