bind method

void bind(
  1. State<StatefulWidget> state
)

Binds a Flutter State to this reactive.

When the value changes, setState() will automatically be called on the bound state.

Example:

counter.bind(this);

Implementation

void bind(State state) {
  if (!_boundStates.contains(state)) {
    _boundStates.add(state);
    state.updateState(); // sync UI immediately
  }
}