Narrows a full service/database to its UI-restricted view (see
FromService): transactions and other mutators become fire-and-forget
void, while observe surfaces pass through. The restriction is purely
type-level — the value returned is the very same instance — so this is the
single sanctioned boundary between the full transactional surface (used by
controllers / bootstrap containers) and the surface UI widgets consume.
T is always assignable to FromService<T> by construction, but TypeScript
cannot prove it for a generic T (the IsValid<T> conditional inside
FromService stays deferred). Rather than reach for a cast, we declare the
precise mapped return as an overload and broaden the implementation
signature to Service — the identity body then type-checks with no cast.
Narrows a full service/database to its UI-restricted view (see FromService): transactions and other mutators become fire-and-forget
void, whileobservesurfaces pass through. The restriction is purely type-level — the value returned is the very same instance — so this is the single sanctioned boundary between the full transactional surface (used by controllers / bootstrap containers) and the surface UI widgets consume.Tis always assignable toFromService<T>by construction, but TypeScript cannot prove it for a genericT(theIsValid<T>conditional insideFromServicestays deferred). Rather than reach for a cast, we declare the precise mapped return as an overload and broaden the implementation signature toService— the identity body then type-checks with no cast.