class ReadonlyRef[A]
A value that can be read and subscribed to.
Attributes#
| Attribute | Type | Description |
|---|---|---|
key | str | |
value | A |
Functions#
subscribe#
subscribe(f) -> Callable[[], None]Call f with each new value; returns the unsubscribe.
| Parameter | Type | Description |
|---|---|---|
f | Callable[[A], None] |
Returns Callable[[], None]
def subscribe(self, f: Callable[[A], None]) -> Callable[[], None]:
"""Call ``f`` with each new value; returns the unsubscribe."""
raise NotImplementedErrormap#
map[B](f) -> ReadonlyRef[B]A ref of f of this one's value, notifying when it changes.
| Parameter | Type | Description |
|---|---|---|
f | Callable[[A], B] |
Returns ReadonlyRef[B]
def map[B](self, f: Callable[[A], B]) -> ReadonlyRef[B]:
"""A ref of ``f`` of this one's value, notifying when it changes."""
return _MapRef(self, f)