Fork me on GitHub
#reagent
<
2016-07-01
>
escherize04:07:38

In that case, i think it would side effect every time some-ratom were deref'd

escherize04:07:03

in re-frame the components side effect once. This can be achieved via a form 2 component.

escherize04:07:58

(defn my-single-side-effect-comp []
  (let [_ (js/console.log "my sideeffect")]
    (fn []
      [:h2 "hi, " (str @atom-name)])))

escherize04:07:15

Here's how I wish people used cljsfiddle. In fact if there's any feedback I'm gearing up to do some upgrades on it....

escherize04:07:45

So, the one-side-effect component will only alert when it's first mounted.

escherize04:07:20

and since some-ratom is not dereffed inside the component it returns, dereferencing some-ratom won't cause a re-render

kauko05:07:13

@escherize: since you brought up cljsfiddle, may I ask: why is it Reagent only?

kauko05:07:21

Shouldn't the name be reagentfiddle or something like that?

kauko05:07:14

the project itself is really cool, I've used to to demo clojurescript to some friends, but I feel like the name should be something else

escherize07:07:01

Well, given that reagent is the most downloaded react interface (view library?) I didn't think it was as much of a stretch as you do.

gadfly36107:07:30

@kauko: imo it makes sense to start off focused, but to use a name that isn't unnecessarily limiting

kauko07:07:42

@escherize: most popular, yes, but not the only one. And there are other ways to do cljs than just React

kauko07:07:58

Imagine if jsfiddle was only for Angular apps

kauko07:07:03

wouldn't that be a bit weird?

kauko07:07:43

especially if it was only for Angular 1.x

kauko07:07:45

and again, the project itself is really good, it's just that I feel that the clojure community would benefit from having a fiddle where it's possible to test cljs code in general

kauko07:07:04

there's definitely a need for a reagent fiddle. It may even be more important than a more generic one!

kauko07:07:46

@gadfly361: so wait, are you agreeing or disagreeing with me? 😄

escherize08:07:22

I do agree with that. Are you proposing a particular action?

escherize08:07:00

Also, of course, in js it's trivial to pull in new libraries - not so with cljs.

plexus08:07:37

note that jsbin supports ClojureScript

plexus08:07:05

library support will be a problem, but for showing pure CLJS stuff it's a good option

kauko08:07:41

something like that

kauko08:07:16

Or alternatively, making the current http://cljsfiddle.com have the ability to do other stuff besides reagent

kauko08:07:48

You certainly have more knowledge of the technical limitations

gadfly36110:07:52

@kauko: I was disagreeing ;) I dont think the name should change

gadfly36110:07:00

My hope would be the community could rally behind it and grow it into it's name (if desired), as opposed to making a bunch of one-off sites

kauko12:07:42

ahh well that's definitely better

lwhorton13:07:57

thanks @mikethompson — I actually found what he’s talking about in that article by browsing in the reagent.core source, but it’s undocumented and makes it hard/dangerous to guess about such things