Fork me on GitHub
#reagent
<
2018-01-15
>
ejelome13:01:14

@gadfly361 awesome! this is great enough. thanks! 😄

ejelome13:01:57

@gadfly361 wow, I actually tried the demo of it and it's really good :thumbsup:

ajs20:01:37

i'm hitting a rather interesting architectural challenge with reagent. is there a way to access state in an ratom without wanting it to perform a re-run of the function (in this case, one that is tracked). For example, I track a function that I want to run when one piece of state changes, but that function, when it runs, also needs access to another piece of state -- but if I access that second item, that will also cause the entire function to run again when that second piece of state changes, even though I only want the function triggered when the first piece changes. In other words, is there a way to simply read the contents of an ratom without the reader getting registered for a re-render/re-track?

danielcompton20:01:31

However unless you're building a debugging tool, I would think more about how to reformulate the problem

danielcompton20:01:35

Why do you want to only rerun on the first piece of data change, but not the second?

ajs21:01:01

indeed, it's more of an architectural problem. i think the problem is I'm relying on Reagent for matters that not related to UI specifically, so I'll refactor that out separately.

ajs21:01:02

i was using app state sort of like a message channel to avoid circular dependencies which can quite easily happen. in the past i used core.async with great effect for things like this and think i'll head back in that direction

sggdfgf21:01:22

(defn run [] ;;Todo this subscription does not run I have no Idea ;;I expect it to run on every :text sub change (let [ok @(re-frame/subscribe [:text])] (clear) (reagent/render-component (my-eval) (.getElementById js/document "baby-dom-target"))))

sggdfgf21:01:22

can not subscribe :thinking_face: 😳 😰

sggdfgf21:01:43

does it subsrcibe only from hiccup?

ajs21:01:30

@faxa you might try the #re-frame channel instead

sggdfgf21:01:06

that makes sense 😉