watch<T> method
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;
}
});
}