-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add modal dialogs #3
Comments
If the modal is created using Elmish commands it will be static. Because the state can't be stored in the global model and no I don't want to speak about hook or stateful components for designing such a components ^^. It could call a callback but probably nothing more but even then it's dangerous in development mode and could lead to broken applications. If an HMR call is triggered while the modal is open, then the callbacks in the modal will not have the right Why do you want to create a model using a command instead of storing the state of the modal in your application and calling the modal in the view? |
Well, if you have a complicated app with a view that you don't remember very well and don't want to touch very much (as it just happened to me) and you're asked to add a confirmation step for an action, it could be a nice way to quickly add the confirmation in your update function. A static modal is ok as long as you have access to the dispatch function and another function to dismiss the modal. The HMR thing is indeed tricky but I personally could leave with that (I just refresh when I see the app behaving funny). |
Zaid made me realize he has already something like that. It'd be nice to have something similar for Fulma apps :) https://zaid-ajaj.github.io/Elmish.SweetAlert/ |
Hum... The thing is all the modal provided by SweetAlert can only support a small kind of things. But indeed, perhaps we can try to cover the most common cases. |
It'd be great to have also the possibility of creating modal dialogs as Elmish commands, maybe here or in a different package.
The text was updated successfully, but these errors were encountered: