Fork me on GitHub
#re-frame
<
2016-07-19
>
dobladez12:07:45

@wasser: It's ok to use lazy seqs in hiccup. Hiccup "realizes" them

wasser12:07:30

I figured it was something like that.

lwhorton18:07:04

is there a simple way to get the previous value of a local component state ratom?

lwhorton18:07:41

since reagent handles the swap! -> render on a deref of a changed input, is there a way to get what used to be in the atom?

mccraigmccraig18:07:35

@lwhorton: store the outgoing value when you swap 🙂

lwhorton18:07:03

i found a tricker way that abuses react

lwhorton18:07:30

an external component subscribes, then immediately hands over its deref’d subscription to an internal component, that internal uses reagent/create-class

lwhorton18:07:53

that gives me access to prev/next on :component-will-update, and allows me to utilize more ratoms internally to get full control

lwhorton18:07:59

(the things we do for animations….)

mccraigmccraig19:07:40

@lwhorton: that seems entirely reasonable. another thing you could do is capture another atom in a form-2 components closure, and use it to record "current" values during render, which will then be "previous" values on next render