-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Does devcards reload when data changes? #15
Comments
In order for the Devcards to be "stateful" while allowing code chages, it has to allow you to set an initial state while not blowing away the state that has accumulated so far. And that is what you are setting in the second parameter, the initial state. So it follows that when you want to return to the initial state, that you reload the page. Does that make sense? If you want to reset to an original state without reloading the page you need to do that explicitly. IE a "reset" link in your app or you can do this:
It is my current opinion that reloading the page is the most natural way to "start over". Does that help? Also you don't want to have the |
Thanks for the clarification. I understand your point about not resetting the state on unmount. But for my use case, I wouldnt mind if the state is reset on unmount. Actually, I expect that to happen always. So may be I will try and write a new devcard to reload the state every time. I am hoping it is not very hard to write one. |
I see that om-root-card does not reload the card when data is changed.
For example, if I change text to "yep it is not", it does not automatically reload unless the page is reloaded
(defcard omcard-ex
(dc/om-root-card widget {:text "yep it is"} {} { :unmount-on-reload true }))
Is there any option I can pass to do this?
The text was updated successfully, but these errors were encountered: