destroyRemChangeSensor function

Future<Null> destroyRemChangeSensor()

A utility that destroys the _changeSensor added to the DOM by initRemChangeSensor.

Can be used, for example, to clean up the DOM in the tearDown of a unit test.

Implementation

// TODO make this a void function
Future<Null> destroyRemChangeSensor() {
  return Future.sync(() {
    _shouldStillMountRemChangeSensor = false;

    if (_changeSensor != null) {
      react_dom.unmountComponentAtNode(_changeSensorMountNode!);
      _changeSensorMountNode!.remove();
      _changeSensorMountNode = null;
      _changeSensor = null;
    }
  });
}