AtomRef: a plain observable value outside any registry (Effect's
effect/reactivity/AtomRef).
make(value) is a ref you set and subscribe to; prop(key)
focuses on one field (a mapping key, a sequence index or a dataclass
field), map(f) derives a read-only ref, and collection(items) is a
list of refs that hears of changes to any of them. Setting an equal value
(Equal) notifies nobody.
Classes#
Functions#
make#
make[A](value) -> AtomRef[A]A ref holding value.
| Parameter | Type | Description |
|---|---|---|
value | A |
Returns AtomRef[A]
def make[A](value: A) -> AtomRef[A]:
"""A ref holding ``value``."""
return _ValueRef(value)collection#
collection[A](items) -> Collection[A]A collection of refs of items.
| Parameter | Type | Description |
|---|---|---|
items | Iterable[A] |
Returns Collection[A]
def collection[A](items: Iterable[A]) -> Collection[A]:
"""A collection of refs of ``items``."""
return Collection(items)