-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples please #22
Comments
For exmaple. Hot to use stent with UI events? |
Hey, there's an example with React here https://github.com/krasimir/stent/blob/master/docs/examples.md#integration-with-react If you need a more complex example can you please come with a use case. I'll be happy to setup one. |
For example I'm working with another library from you "Navigo" :) and I want to move between pages using stent, my problem are the links. Right know it took my 3 steps (states) to get to a page (D), but from that page I want a link to the first one (A), how could I make to go from D to A in only one step?
I want to go from registerDevice to Login |
I'm glad that you are using Navigo as well. I miss some context to answer properly here tho. What you control with Stent, is it pages or it is states of your app. It looks like you are mixing two different responsibilities. |
Exactly I'm a little confuse in how to use stent and I'm mixing things. I'm not sure in how implement stent to control the stet of my app. I would like to do 2 things:
|
Well, I'll suggest to define what does state means to your app. This could be for example:
Then put those states in a state machine. The second thing is: do you want to send the user to a different page based on the app state. If yes then I'll suggest to create a middle man and put the required logic there. For example, if you want to forward the user to a login page if he/she is not logged in you do something like:
So, my point is that the routing and the state management should be separated. |
I read the article, the git documentation...but I don't know how to implement the state machine (stent( in my project. Any basic project example (more explanatory than the TODO example?)
_
The text was updated successfully, but these errors were encountered: