Is it possible to use re-frame
with devcards
? There is an old issue still open https://github.com/bhauman/devcards/issues/105 that seems to imply that its not easy to use re-frame with devcards
Sure it is possible or sure it is not possible? Any examples of how it is possible? Thanks!
it is possible.
> You can then use the `defcard` macro. `defcard` is a multipurpose macro which is designed to take what you are working on elevate live into the browser. It can handle many types of data but primarily takes any type of ReactElement.
(http://rigsomelight.com/devcards/#!/devdemos.defcard_api)
You can convert hiccup using as-element
function in reagent into the ReactElement: https://reagent-project.github.io/docs/master/reagent.core.html#var-as-element
Example can be seen here: https://github.com/imatic/re-frame-form/blob/f88f9bf949541f661aae7ffca0f88c4a5a8e0ec2/examples/re-frame-form/src/example/core.cljs#L85 with the ui: https://imatic.github.io/re-frame-form/
Thanks! Will check that out. That issue in devcards just made me assume it was difficult to use re-frame with devcards. I ended up using nubank/workspaces but will go back and try it with devcards now. (actually had some issues with updates happening properly with workspaces that Ihaven’t debugged yet)
I don't have the problem with subscriptions. I've never tried workspaces.
Appreciate your help!
Just to confirm, everything is working great for me with re-frame, devcards and shadow-cljs. I guess the issues people were having was more if they wanted separate re-frame app-db for individual devcards. I do not have that requirement. The issue of the cards / reagent components updating reactively in both devcards and workspaces, was my own error of not wrapping the hiccup passed to defcard-ng in a function.