intercellular/cell

Updating cells

mrjjwright opened this issue · 2 comments

I am working on a Mobx integration. I don't use local state on components, but Mobx, because Mobx is a comprehensive solution for minimal state. I am still working out how to best integrate Mobx and cell.js. I assume I should call $update on the cell I want to update explicitly. What is the official way to force an update or render of a cell or component (cell subtree)? In React it's called forceUpdate (that is what mobx-react uses).

Thanks for this awesome library!

The "official" way to updating cell nodes is to

  1. attach some _variables that represent the node (and will translate into the view).
  2. update the _variables
  3. and let that auto-trigger the $update() function on the same node, from which you can modify the node's view.

But manually triggering $update() is valid too, and I can imagine in some cases that's necessary. Keep us posted how that goes!

Thanks!