Mirror / Mirrored state

What the Model being the truth gives

  • Defaults. App.initial holds every field's default, so a key at its initial value is elided from the store. keys: { page: { keep: true } } keeps one written.
  • Batching. The entry's dependencies are the encoded keys, so one Model change is at most one write, and a change that encodes to the same keys is none. Back and forward cannot loop: popstate reduces into the Model, the entry sees the same keys, and stops.
  • Codecs. A key's codec is derived from the field's encoded initial value (string, number, boolean; JSON otherwise), and keys: { tags: { codec } } supplies a readable one.
  • Links. Filters.href(model, { page: 2 }) is the current URL with the mirrored keys applied, so a link is computed from the Model, not assembled.