bhauman / devcards

Devcards aims to provide a visual REPL experience for ClojureScript
1.53k stars 115 forks source link

reagent devcard #16

Closed dagda1 closed 9 years ago

dagda1 commented 10 years ago

Does devcards work with reagent and if not, could somebody give me a rough idea as to what would be involved in creating a base card that works with reagent.

jdmarble commented 10 years ago

See #12 for an idea on how to get started. I've put the card from that pull request directly in my source. Not very clean, but it gets the job done.

bhauman commented 9 years ago

Reagent now works with devcards.

whodidthis commented 9 years ago

Not sure if possible, but would be interested if someone has an idea on how to use with re-frame

bhauman commented 9 years ago

@whodidthis it should work for the individual reagent components right?

whodidthis commented 9 years ago

They work great, re-frame just has this predefined app-db atom that might make devcards impossible.

Out of interest, is there anything interesting to the atom you can feed to defcard when it comes to reagent? Is there any difference between

(defonce my-atom (reagent.core/atom {}))

(defcard my-card
  (dc/reagent [my-component my-atom]))

and

(defcard my-card
  (dc/reagent my-component)
  my-atom)

Or is it just as a backup if people want to use om-cards and reagent-cards in a similar way.

bhauman commented 9 years ago

You get the history and data inspection with the second method.

whodidthis commented 9 years ago

Cool, didn't realize