Fork me on GitHub
#hoplon
<
2018-11-21
>
James Vickers01:11:26

Do I need original-cell? Like what if I just did

(cell= (dosync
  (reset! cell1 (value-fn-1 cell2 cell3))
  (reset! cell2 (value-fn-2 cell1 cell3))
  (reset! cell3 (value-fn-3 cell1 cell2)))) 
Would Javelin know that in that expression cell1, cell2 and cell3 are Javelin cells that need watches added? I figure it would since it somehow does that for other kinds of cell= expressions.

James Vickers01:11:14

Where those value-fn functions compute the value of one of the cells based on the values of the other two or whatever.

alandipert03:11:56

it would add the watches i think, but could result in a cycle

alandipert03:11:06

sorry i didn't have a chance to make an example for you, will do asap

flyboarder20:11:20

@jamesvickers19515 yes it will add the watches for you, however that would no longer be a lens cell

flyboarder20:11:15

cell= has 2 arguments the first is the cell to watch which updates the value for cell= the second is a callback that should be invoked when trying to update the cell=

flyboarder20:11:02

your example would create an infinite loop