Mirror / Mirrored state
Why keeping the Model authoritative prevents drift
- Defaults stay out of the URL:
App.initialdefines every field's default, so any field matching its initial value is removed from the store. Passkeys: { page: { keep: true } }when a default value should stay visible in the URL. - No navigation loops: Each subscription tracks the encoded key string as its dependency. One
Modelchange triggers at most one store write, and apopstatenavigation reduces the URL back into theModel, produces the identical key string, and stops. - Automatic codecs: String, number, and boolean fields encode directly as readable query values, while complex fields use JSON unless you provide a custom
keys: { tags: { codec } }. - Safe link building:
Filters.href(model, { page: 2 })computes a link from the liveModelwith only the target key changed, instead of concatenating query strings by hand.