Fork me on GitHub
#re-frame
<
2016-07-15
>
naomarik00:07:44

just to describe from memory what i think i saw, something that was like a maybe 100x100 px square fixed on the right side of the page, then clicking on it would expand in a tree like fashion showing you everything in the atom

darwin00:07:09

wondering why cljs-devtools is not suitable for inspecting it during dev

darwin00:07:24

without interfering with your app’s DOM state

darwin00:07:45

btw. have been working lately on proper support for deftype/defrecord in cljs-devtools: https://dl.dropboxusercontent.com/u/559047/cljs-devtools-upcoming-support-for-types.png

darwin00:07:58

that yellow-ish area was produced by IPrintWithWriter protocol

darwin00:07:42

so you can drill down into type internals, instance internals, or stuff emitted by IPrintWithWriter

mikethompson00:07:20

I can see Person implements IFormat ?

richiardiandrea00:07:59

Oh very nice indeed

darwin00:07:09

IFormat is just new IDevtoolsFormat, I wanted to move all protocols under new namespace, so I renamed it as well

darwin00:07:20

IDevtoolsFormat will still work, but will be deprecated

darwin00:07:29

also want to refactor it in a way that reusable templates can be easily called by people implementing their own IFormat

vikeri12:07:21

Is there anything I have to be aware of when working with subscriptions and infinite lazy sequences? I’m experiencing some weird behavior when sometimes the ultimate subscription (that only takes the first 14 of the lazy sequence) will not return and get stuck in an infinite loop instead.

vikeri12:07:08

Found the issue, I was inspecting the function with s/fdef that is why it went into an infinite loop.

snowell13:07:07

Can anyone point me to an explanation of how to pass query params into the new def-sub function?

snowell13:07:42

You know what, now that I’ve asked I think I may have found the answer. 🦆

lwhorton14:07:10

is it correct to assume ratoms dont behave well inside maps?

lwhorton14:07:35

(let [some-ids (reaction (q/ids @db))
      some-entities (reaction (q/entities @db))
      changed (reaction (map (fn [id] (merge (get @some-entities id) {:test true})) @some-ids))])

lwhorton14:07:57

I have a suspicion that in this circumstance, those maps over @some-entities won’t react

mccraigmccraig14:07:13

@lwhorton: map is lazy - you might need to force it with doall or dorun

lwhorton14:07:55

ooh good point, ill give that a whirl

lwhorton14:07:13

that was exactly it @mccraigmccraig .. so it’s nice to know that (reaction thing) doesn’t realize thing

lwhorton14:07:10

thanks for that — I was pulling my hair out

wasser15:07:33

I tend to use (for ...) although I find it "distasteful" (looks too much like imperative loops 😫). But having to clutter (map ...) with a (do___) isn't any better.

shaun-mahood15:07:52

After all the discussion lately about using re-frame with devcards, are there any publicly available examples of a project using it? I wouldn't mind going through something working to update both the re-frame and devcards wikis with instructions and examples.

jakemcc17:07:53

@naomarik: Not sure exactly what you’re talking about, but we’ve adapted https://github.com/noprompt/ankha to get something similar to what you’re describing (click thing, see atom, click more to dig into it)

jakemcc17:07:49

@naomarik: can shove that code in a gist if you want it.

shaun-mahood17:07:13

@naomarik @richiardiandrea ^ Might be what you were talking about earlier, similar concept I believe

richiardiandrea17:07:44

Great I think that's exactly what I was thinking about 😉

naomarik17:07:15

@jakemcc: I believe this is exactly what i meant!

jakemcc17:07:07

should give you a starting point

dobladez18:07:07

@wasser: mind that (for ...) is also lazy, and purely functional... it's not "imperative"

nberger18:07:58

@shaun-mahood: there are some examples of re-frame+devcards using iframes in https://github.com/nberger/devcards/blob/iframe/example_src/devdemos/re_frame.cljs. it's basically some of the reagent examples adapted to re-frame

shaun-mahood18:07:58

@nberger: Awesome, thanks! I'll see if I can get something started so we have somewhere consistent to point to when the question comes up again.

nberger19:07:28

I think there's room for adding macro sugar to make it easier to create the cards. At the implementation level there were also some suggestions from Bruce to use IDevcardOptions and implement it as a custom devcard or something like that. I didn't have enough time to get to that point, help is welcome in that area :)

nberger19:07:17

@shaun-mahood: cool, that sounds great!

wasser20:07:42

@dobladez: your right. I didn't mean to imply that it IS imperative, just that it looks that way. When I see a "for" my brain says "Java", when I see a "map" it says "Clojure"

dobladez20:07:38

right, but you suggested to use for instead of (doall (map ... . But you also need doall when using for

dobladez20:07:48

or I misundertood