watch method

CellWatcher watch(
  1. void fn()
)

Register a watch function (fn) that is run when this cell is triggered.

fn is only called when the value of this cell is updated after the watch function is registered. That is it is not called immediately on registration.

Implementation

CellWatcher watch(void Function() fn) => Watch((state) {
  observe();
  state.afterInit();
  fn();
});