Fork me on GitHub
#reagent
<
2020-06-28
>
mikethompson06:06:09

@neural.works.com I'm confused by the question. By "very first value of my ratom" • I assume you mean the ratom c in doit • if so, do you mean you want the value in c before the swap! in btn ?

neural16:06:39

@mikethompson Hi Mike sorry about the confusion!! you are right how i get the value o 'c' before the swap! ?

whoops21:06:38

@neural.works.com You can't. Once the swap happens it's swapped. The old value isn't retained. You need to store it elsewhere and not update it. Something like

(let [init 0
      c (r/atom init)]