Welcome to the forums @jajoosam!
Here’s a quick fix:
- The reason you get an infinite loop is that the “need help” cell has a reference to
total
. Formutable
variables, recall thatmutable total
is a non-reactive reference andtotal
is a reactive one (meaning that whenmutable total
is changed, all cells that referencetotal
will be re-run). The fix was just to replacetotal
withmutable total
- I got your
viewof toAdd
button to work by adding a reference totoAdd
in the “need help” cell. The way views work, clicking on the button causes the button to dispatch aninput
event, which causes the runtime to re-evaluate all cells that depend ontoAdd
.