pub fn freshness(pending: usize) -> ValueExpand description
Freshness — whether the page about to be rendered is of the confirmed state or of a guess.
§3.7: “Signal[T] carries a freshness dimension (confirmed | pending(n)) that UI code can
render ("saving…") — staleness is typed, not pretended away.”
n is how many of this client’s own commands are folded into the state being rendered and not
yet reflected in what the server has confirmed. Zero is Confirmed rather than Pending(0),
which is the one decision in this function: a page asking “is this a guess” would otherwise
have to know that one of the two variants sometimes means the other.
Built here, beside the other four, because a Mode B client is the only thing that ever produces
a non-Confirmed value and the server produces the confirmed one — two constructors would be
two spellings of a union the same view matches on.