Expand description
Utilities for working with Perseus’ state platform.
Structs
A representation of a frozen app.
A representation of the global state in an app.
A creator for global state. This stores user-provided functions that will be
invoked to generate global state on the client and the server.
A container for page state in Perseus. This is designed as a context store,
in which one of each type can be stored. Therefore, it acts very similarly
to Sycamore’s context system, though it’s specifically designed for each
page to store one reactive properties object. In theory, you could interact
with this entirely independently of Perseus’ state interface, though this
isn’t recommended.
An entry for a single page in the PSS. This type has no concern for the
actual type of the page state it stores.
The user’s preferences on state thawing.
Enums
The user’s preferences on page state thawing. Templates have three places
they can fetch state from: the page state store (called active state), the
frozen state, and the server. They’re typically prioritized in that order,
but if thawing occurs later in an app, it may be desirable to override
active state in favor of frozen state. These preferences allow setting an
inclusion or exclusion list.
The various things the PSS can contain for a single page. It might have
state, a head, both, or neither.
The page state of a PSS entry. This is used to determine whether or not we
need to request data from the server.
Traits
A convenience super-trait for
Freeze
able things that can be downcast to
concrete types.A trait for reactive
struct
s that can be made unreactive and serialized to
a String
. struct
s that implement this should implement MakeUnrx
for
simplicity, but they technically don’t have to (they always do in Perseus
macro-generated code).A trait for
struct
s that can be made reactive. Typically, this will be
derived with the #[make_rx]
macro, though it can be implemented manually
if you have more niche requirements.A trait for reactive
struct
s that can be made un-reactive. This is the
opposite of MakeRx
, and is intended particularly for state freezing. Like
MakeRx
, this will usually be derived automatically with the #[make_rx]
macro, but you can also implement it manually.