2.1 KiB
2.1 KiB
@theatre/dataverse / Prism
Interface: Prism<V>
Common interface for prisms.
Type parameters
Name |
---|
V |
Table of contents
Properties
Methods
Properties
isHot
• isHot: boolean
Whether the prism is hot.
Defined in
isPrism
• isPrism: true
Whether the object is a prism.
Defined in
Methods
getValue
▸ getValue(): V
Gets the current value of the prism. If the value is stale, it causes the prism to freshen.
Returns
V
Defined in
keepHot
▸ keepHot(): VoidFn
Keep the prism hot, even if there are no tappers (subscribers).
Returns
VoidFn
Defined in
onChange
▸ onChange(ticker
, listener
, immediate?
): VoidFn
Calls listener
with a fresh value every time the prism has a new value, throttled by Ticker.
Parameters
Name | Type |
---|---|
ticker |
Ticker |
listener |
(v : V ) => void |
immediate? |
boolean |
Returns
VoidFn
Defined in
onStale
▸ onStale(cb
): VoidFn
Parameters
Name | Type |
---|---|
cb |
() => void |
Returns
VoidFn