think i figured out a good way to build devcards for re-frame components that doesn’t rely on global state if anyone’s interested
short version: push the subscriptions out of the component itself and pass in a fn to do dispatch with
@peeja it seems like if you have a separate build for devcards and also put a cards.html into a resources directory that is only available at dev time you should be set
@spieden: it would be good to have a devcards reference page for reframe. I haven't used it yet so I my look at it soon lots of folks are wondering about this.
@bhauman: Oh, yeah, that should work! I forget you can do that… :simple_smile:
What about rendering re-frame components in devcards with global state, and "real" dispatch and everything? It would be kind of an "integration" devcard. I know this is complicated with re-frame because of the state, handlers and subscriptoins all being global... But perhaps it could work if each devcard is actually rendered in an iframe? I think @pandeiro suggested this idea to me some time ago, and I don't see why it could not work... What do you think about it?