clear method

void clear()

Clears all state values for the current mini-program instance.

Implementation

void clear() {
  _ensureActive();
  if (_values.isEmpty) {
    return;
  }
  final changedPaths = _values.keys.toList(growable: false);
  _values.clear();
  if (_batchDepth > 0) {
    _pendingChangedPaths.addAll(changedPaths);
    return;
  }
  _branchMetrics.clear();
  for (final watcher in _watchers.values) {
    watcher.value = null;
  }
}