This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Does anyone have any experience using devcards with re-frame? When I try to access re-frame subscriptions from a Reagent component in a devcard, I always get nil -- which I suppose makes sense, since I wouldn't want my devcards to access and mess with the main application state. Would it be possible to write a devcards.core/re-frame
macro, similar to devcards.core/reagent
except that the re-frame variant takes a re-frame app-db instead of a Reagent atom as input?
Devcards are so awesome that I am half tempted to drop re-frame and switch to Om Next just to get everything working, but unfortunately I am too stupid and the Om Next tutorial makes my brain hurt.
Perhaps it's possible to simply change the global re-frame atom to a dynamic var, and then hack up a devcards macro that rebinds this var to a user-supplied atom for the individual devcard? I'll give it a try, unless somebody else already has a working solution.
@bhauman: Thanks, I'll give it a try. I've just realized that my idea above is of course not going to work: By the time the user tries to interact with the component, the dynamic rebinding of the re-frame atom will have expired. I'll have to come up with something better.
@tord if you are just starting out you can just use straight React and sablono. I recomend it highly when you are getting started
it also has the added benefit that your project will not be attached to an "evolving" framework
@bhauman: I am "just starting out" with devcards, but I've built a couple of moderately complex apps with Reagent and re-frame and feel quite comfortable using them. Your advice to do some work with plain React is probably still good, though. There is a little too much magic I don't quite understand in Reagent; a better understanding of plain React would certainly help.