Skip to main content

euv_ui/hook/use_storage/
struct.rs

1use super::*;
2
3/// Reactive state for one stored value.
4///
5/// The handle carries the key it watches, the current value, and the
6/// kind of storage it lives in.
7///
8/// The value is a `Signal<String>`: a render closure that reads it
9/// re-renders when the value changes, and nothing else in the tree is
10/// disturbed.
11#[derive(Clone, CustomDebug, Data)]
12pub struct UseStorage {
13    /// The storage key this handle watches.
14    #[get(type(copy))]
15    pub key: &'static str,
16    /// The current stored value.
17    #[get(type(copy))]
18    #[set(skip)]
19    pub value: Signal<String>,
20    /// Which storage the value lives in.
21    #[get(type(copy))]
22    pub kind: UseStorageKind,
23}