Open wilkerlucio opened 9 years ago
Try :watch-atom true
this causes om to re-render on reload.
I really like this idea though. I haven't worked extensively with the cards and om. Om is conservative with it's rendering, only rendering when data changes. There are other tricks to working live as well. I may make :watch-atom
default to true for Om for now. I'm going to work on the Om example page next so that I can see all these edge cases and have a good idea how to plan for refreshing them properly. But if you want to work on the devdemos.om
page feel free.
Sure, I'll try to implement something like that myself later, I'll let you know if I ran in any issues with the codebase. Thanks.
And I agree with the :watch-atom true
to be default for Om for now, will be very helpful until there is a better solution.
watch atom true deployed!
While developing here I'm noticing that I'm having to manual reload a lot (mostly by renaming the card that I'm working on). I saw what you said about data reloading at the issue #15, but at same time, when you change data on your video demo it reloads (there you are using Sablono, not sure if it matters).
I noticed my cards only get re-render if I interact with then or remove/add/rename, and I think the workflow could be much better if they just re-render all the times when reloading (or maybe even on a render loop).
I propose that we have some sort of settings for how to deal when code updates, it could be an extra key at the configurations like
:reload-policy
, and here and some ideas for values of it::none
- this is like the current one, the component doesn't re-render on code reload:render
- just re-render the component keeping the state (the props on the atom):refresh
- render all over again with the data on code (discard current state)So we could write:
These are just ideas to deal with the problem of having to manually reloading the cards against code changes, please let me know your thoughts/ideas on that matter.
Thanks.