Obs<T> class
一种可观察的(observable)状态封装
Constructors
- Obs(T initValue)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- observerCount → int
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → T
-
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onActive(
) → void - 观察者个数从0到1
-
onInactive(
) → void - 观察者个数从1到0
-
setValue(
T newValue, bool force) → void -
subscribe(
Observer< T> observer) → Subscription<T> - 添加观察者
-
subscribeSticky(
Observer< T> observer) → Subscription<T> - 添加观察者,并且会立马回调当前值
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited