watch<T> method

Stream<T?> watch<T>(
  1. String key
)

Implementation

Stream<T?> watch<T>(String key) {
  return _dataSubject
      .map((data) => data[key])
      .distinct()
      .map((value) {
    if (value == null) return null;
    try {
      return value as T;
    } catch (e) {
      debugPrint('IceStorage SecureService: Error casting $key to $T');
      return null;
    }
  });
}