DecisionEngine

The heart of the offline-first read path: a PURE function from (data snapshot, connectivity) to the single ScreenState a screen renders. No coroutines, no I/O — exhaustively unit-testable.

Error routing is delegated to a caller-supplied ErrorKind classifier so this stays decoupled from any HTTP client / exception hierarchy (the default treats every error as ErrorKind.Other).

Functions

Link copied to clipboard
fun <T> decide(storeData: StoreData<T>, connectivity: Connectivity, ttl: Duration, now: Instant, classify: (Throwable) -> ErrorKind = { ErrorKind.Other }): ScreenState<T>