Derive Macro perseus::ReactiveState
source · #[derive(ReactiveState)]
{
// Attributes available to this derive:
#[rx]
}
Expand description
Processes the given struct
to create a reactive version by wrapping each
field in a Signal
. This will generate a new struct
with the given name
and implement a .make_rx()
method on the original that allows turning an
instance of the unreactive struct
into an instance of the reactive one.
If one of your fields is itself a struct
, by default it will just be
wrapped in a Signal
, but you can also enable nested fine-grained
reactivity by adding the #[rx(nested)]
helper macro to the field.
Fields that have nested reactivity should also use this derive macro.