refresh method

  1. @override
void refresh()

Manually refresh this observale.

Useful in case of unmanagable object. if you have an Object like

    class User {
      String name;
      int age;
      User(this.name, this.age);
    }

and you want to use an instance of this class as an observable. you can do something like this to notify all observers that some changes happened.

final userObs = Of(User('Patrick', 23));

userObs.value.age++;

userObs.refresh();

Implementation

@override
void refresh() {
  for (var listener in _listener) {
    listener.call(value);
  }
  _alert
    ..forEach((alerter) => alerter.call(value))
    ..clear();
}