watch method

Future<ChannelState> watch()

Loads the initial channel state and watches for changes.

Implementation

Future<ChannelState> watch() async {
  ChannelState response;

  try {
    response = await query(watch: true);
  } catch (error, stackTrace) {
    if (!_initializedCompleter.isCompleted) {
      _initializedCompleter.completeError(error, stackTrace);
    }
    rethrow;
  }

  if (state == null) {
    _initState(response);
  }

  return response;
}