IReadableAtom<T> interface
Namespace: Arlecchino.Atoms · Assembly: Arlecchino.Core
Something that holds a value and tells interested parties when it changes. Implemented by Atom and Computed.
public interface IReadableAtom<T>
Properties
| Member | Summary |
|---|---|
Value | The current value. Reading it inside a Computed registers the dependency, so derived values need no dependency list. |
Methods
| Member | Summary |
|---|---|
Subscribe(Action) | Calls back whenever the value changes. |
Properties in detail
Value
public abstract T Value { get; }
The current value. Reading it inside a Computed registers the dependency, so derived values need no dependency list.
Type T
Methods in detail
Subscribe(Action)
public abstract IDisposable Subscribe(Action listener);
Calls back whenever the value changes.
Parameters
| Name | Type | Description |
|---|---|---|
listener | Action | What to run on change. |
Returns IDisposable — Dispose it to stop listening; a view that subscribes must do so when it goes away.