Recipes
Recipes
One page for each thing you actually put together. A screen, the exchange, tests, UIKit, view models, Relay, and the builds.
- AgentsThe page a coding agent reads first: what to read, the shape of a screen, what never to write, what to run, and a review checklist.
- Previews and testsA store without a server: a fixture committed as a response, recorded transports, a held mutation, a rule tested with a value.
- The exchangeA challenge, a retry and a deadline over the transport's one verb, compiled in both runtimes.
- A budgeted transportA queue, a meter and an outage over the transport's one verb, for an API that rations requests, in both runtimes.
- UIKit and AppKitA handle held by a controller: the same reads, without SwiftUI.
- Views and view modelsA Kotlin handle without a composition: a view model behind Android Views reads through
snapshotFlow. - Outside viewsA fetch, a read and a write from code that is not a view: a service, a background refresh, a notification handler.
- AccountsA sign-out, a switch and what the disk keeps: the environment is the session, and the account is in the image's identity.
- Derived state outside viewsA model over
Observationsthat keeps a value computed from the store. - Discover once, refresh by idThe pattern for external keys: look a subject up by its natural key once, then refresh any number of them through
nodes(ids:). - An unpaged collectionA whole list in one request: a long expiration, a grouping from each entry's own fields, and the image for the next launch.
- Fields a server nulls by pathWhat a list fragment selects when a server answers a field differently by the path that reached it, and a probe that tells.
- A Json scalarA JSON scalar read as a type of the app's, one type per scalar, and never a dictionary on the read path.
- A backend that is not GraphQLA socket of another protocol or a REST endpoint in the store: a schema file, a raw response, and the app's transport or a service.
- A fast stream, pacedA feed over many keys in the store: what a tick costs, the newest value per key, and one payload per interval through a client list.
- Porting from RelayRelay's words beside Baton's, in Swift and in Kotlin; what differs on purpose; what is not ported and why.
- The compiler's command line
batonc: the command's contract for a build outside SwiftPM. - GradleThe Kotlin runtime from Maven Central and the compiler as a task.
- BazelThe compiler as a toolchain and one rule over its command.
Baton