Optional_Identifies this object as an observer of other observables. Assigned on first use.
The contract name, shared by every client's model for this screen.
Privateisrefresh would do something useful now.
The focus target this model last asked for, or '' for none. Setting it asks the view to move focus there, every time, even to the same target. It is a view id, never a node or a coordinate.
This is a request, not the current focus. To follow where focus is,
override focused.
The last load failed and nothing is shown in its place.
A load is in flight.
Stop in-flight work without leaving the screen.
The screen is gone. Later results must be ignored.
The view reports that focus moved to target for a reason other than this
model asking: the user navigated, or the view restored focus. A focus move
this model requested through focus is not reported back.
What a tool sees: name, current state and available actions.
A key reached the view that holds this model without a focused control handling it first.
The key, as a Key value such as 'back' or 'play'.
true for the press, false for the release.
true if this model handled the key; the view and its parents then ignore it.
Reusable
Sends a contract action by name, as a tool or a test does.
false when there is no such action.
Load again on request; also the retry after a failure.
Observing other observables
@observable(['fieldA', 'fieldB']) other!: OtherObservable on an
HsObservable subclass observes those fields of other, the same way the
decorator does on a view. Changes arrive in onObservableFieldUpdated.
OptionalfieldFilters: string[]The screen is visible again. Restart what suspend stopped.
Optionalcontext: unknownObserves again after dispose(), using the objects currently held in the @observable fields.
Assignment to an @observable field: observe the new object and notify this object's own observers.
The screen is shown for the first time. context is what only the view knows, such as layout.
Optionalcontext: unknownThe screen is no longer visible but still exists. Stop in-flight work.
Optionalvalue: HsObservable
A screen's view model:
HsViewModelplus the loading state every screen shares, already in its contract. A screen overrideshasError(andcanRetrywhen it differs), setsrequesting, and declares only its own state and actions.