watch<T> static method

Stream<T?> watch<T>(
  1. String key, {
  2. bool emitCurrent = true,
})

Emits the value of key now and on every change. ULocalStorage.watch<int>("cartCount").listen(updateBadge)

Implementation

static Stream<T?> watch<T>(String key, {bool emitCurrent = true}) => _storeFor(key).watch<T>(key, emitCurrent: emitCurrent);