ArlecchinoAsyncStore | A store that has to fetch something before it holds the truth. Override ArlecchinoAsyncStore.LoadAsync, and the load is started as the application starts and its bookkeeping kept. csharp public sealed class SettingsStore : ArlecchinoAsyncStore { public TrackedAtom<string> Server { get; } = new("127.0.0.1"); protected override async Task LoadAsync(CancellationToken token) { await using var fs = new FileStream(SettingsPath, FileMode.Open, FileAccess.Read); var saved = await JsonSerializer.DeserializeAsync<Saved>(fs, cancellationToken: token); Server.Post(saved.Server); } } |
AsyncAtom<T> | A value produced by background work, with its progress exposed as state for a view to draw. Results are handed back on the drawing thread, and a new load cancels the one before it. |
AtomHistory | Undo and redo over every TrackedAtom, collecting from the moment it exists. The stack is bounded, and steps past AtomHistory.Capacity fall off the far end. |
Atom<T> | One piece of application state that notifies what reads it and marks the frame stale by itself. Whether an edit can be undone is decided by creating a TrackedAtom or a LocalAtom. |
Computed<T> | A value derived from other atoms. It re-evaluates lazily and tracks whatever it read while doing so, including other computed values and branches taken only sometimes — reading other.Value inside the lambda is the subscription. |