Fork me on GitHub
#devcards
<
2016-01-05
>
spieden00:01:53

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

spieden00:01:38

short version: push the subscriptions out of the component itself and pass in a fn to do dispatch with

bhauman16:01:30

@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

bhauman16:01:15

@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.

peeja16:01:38

@bhauman: Oh, yeah, that should work! I forget you can do that… simple_smile

nberger18:01:38

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?