getCurrentInstance function

WatcherRaw getCurrentInstance()

Returns the current WatcherRaw instance.

Throws a NoWatcherFoundException if no watcher is currently active.

Implementation

WatcherRaw getCurrentInstance() {
  final currentWatcher = getCurrentWatcher();

  if (currentWatcher == null) throw NoWatcherFoundException('No watcher found');

  return currentWatcher;
}