Fork me on GitHub
#reagent
<
2016-01-18
>
dvcrn09:01:02

what is the best practice for swapping / integrating a subview inside a other one? Should I put the entire thing into state and just let my root-view take whatever is under :view and display that? Or should I do something like (if (:show-detail state) ...)

dvcrn09:01:26

or in general dynamic component composing

jaen09:01:29

Yup, I do it more or less like re-frame as well. It works okay so far.

mikethompson10:01:28

@dvcrn: my preference is to only ever put plain data into the ratoms. Then the renders make their decision based on that data -- when deciding which sub-render should be used. I don't like the idea of putting references to renderers into a ratom ... just simple data (apart from anything else this makes it easier to use figwheel because you won't want a r/atom holding a reference to your OLD renderer, when figwheel was loaded a new one).

dvcrn10:01:01

yeah that makes sense. That's also why I asked initially simple_smile

pepe10:01:01

@gadfly361: what library you’re using in [h/fake-content] (what is the h namespace), please?

pepe10:01:29

and also soda-ash seems pretty nice to me, thanks

gadfly36115:01:10

@pepe [h/fake-content] is just a lorem ipsum paragraph. The "h" is what i aliased this helpers namespace: https://github.com/gadfly361/soda-ash/blob/master/src/devcards/soda_ash/elements/card_helpers.cljs#L4

pepe15:01:08

@gadfly361: ok, I thought some library like Faker in Ruby 😉, thanks

gadfly36115:01:17

Thanks for mentioning! I should probably clarify in the docs, i can see how that comes outa nowhere now.

sooheon17:01:28

@gadfly361: hey, I’m really enjoying soda-ash. I was wondering how you would recommend approaching the more complex semanticui stuff involving their proprietary scripts (like this neat github search http://semantic-ui.com/introduction/new.html#fully-customizable-json) or their validation? Is it outside the scope of the library?

gadfly36117:01:30

@sooheon: glad you're enjoying it! I haven't yet given it much thought. I'm going to try and cover most of the class related stuff first, and then circle back to think about a more 'reagenty' way to do some of the javascript bits. As an aside, I am happy for help/suggestions on how to best go about that.

sooheon18:01:50

gadfly361: Ah I see. I have no real good ideas for that either, but it’d be pretty great to have a simple way to use all of that extra functionality.

jaen18:01:03

@sooheon: if you scroll up a bit there was some discussion about using semantic-ui components, like the dropdown for example.

jaen18:01:48

Not sure if things like validation make as much sense in Clojurescript/React though if you can just hook bouncer/validateur/schema/whatever.

sooheon18:01:33

jaen: thanks! will check it out. For validation, I am using the cljs libs you mentioned for the logic, but I was thinking it’d be nice to have a reference front-end implementation that works just like [this](http://semantic-ui.com/introduction/new.html?first-name=&amp;last-name=#updated-form-validation) for example.

gadfly36118:01:42

@jaen @sooheon dropdown snippet above is a great reference!

jaen18:01:02

@sooheon: yeah, it would probably be nice to have something like that, but I guess it's more of a job for a React form library if anything. I'm not even 100% sure if React would take kindly to jQuery mucking in it's divs.

jaen18:01:22

I think I had some sort of a mini-library to that effect, but never polished it enough to consider OSing it.

jaen18:01:45

But I guess at least reagent form libraries must have something like that.

jaen18:01:54

@gadfly361: well, it's nothing one couldn't construct with re-frame's tutorial on stateful components and semantic-ui's example, but thanks nonetheless.

gadfly36119:01:33

<3 re-frame docs

jaen19:01:52

Yeah. Even in that case you already figured some of what they describe, they are still great review material.