STATE

Store

A Store is shared application state declared once in an imported module and available to every importing page or layout.

INTERACTIVE EXAMPLE

Shared preference

This page imports a persistent Store. Its value is shared across routes and restored by target-local storage after restart.

Application preference

Compact mode is enabled. Another page that imports this Store reads the same value.

dowe
store preferences persistent:true value:{ compactExamples:false }

import preferences from "@/views/store/preferences"

page SettingsPage
  Button onClick:{ set:preferences.compactExamples value:!preferences.compactExamples }
    "Toggle preference"

One declaration

A Store module owns its initial value, type, persistence policy, and storage identity. Consumers import it; they never redeclare it.

Keep secrets server-side

Persistent Stores use device-local convenience storage. Do not place server secrets or credentials in a View Store.