notifySourceChanged method

  1. @mustCallSuper
void notifySourceChanged(
  1. K key
)
  • this cancels and subscribes again for the same key
  • mostly used to change the stream in runtime

Implementation

@mustCallSuper
void notifySourceChanged(K key) {
  assert(
    streamSubscriptions.containsKey(key) == true,
    'There is no Subscription related to provided key',
  );
  disposeStream(streamSubscriptions[key]!);
  streamSubscriptions.remove(key);
  streamSubscriptions[key] = listenToStream(key, streams[key]!.stream);
}