Fork me on GitHub

I’ve just started learning cljs / reagent and have hacked a simple app together, but don’t think I understand how reset! atoms ripple changes to referencing components. I have some code at but when the button.onclick event triggers, it reset!s the atom, changing data, but the Highchart isn’t updated. Am I right in thinking this should affect the chart? Is it how I’m binding to chart-config in home-did-mount?


Forgive me, I dont have time to take a close look at this, but consider using swap! Instead of reset! And :component-did-update instead of :component-did-mount


@gadfly361 cheers for advise, had tried the more typical swap which hadn't worked but :component-did-update sounds like a good solution. Thank you.


Also, I knocked the code together quickly to play; I should have refactured before posting to make and if easier to read.


(swap! chart-config assoc :series [{:name "what" :data [1 2 3]}])


Btw, post is fine, im just time constrained and can't sneak away from work long enough to read it haha