shareable

Macro shareable 

Source
macro_rules! shareable {
    ($(#[$meta:meta])*$vis:vis $IDENT:ident: $Ty:ty = $($init:tt)*) => { ... };
}
Expand description

Declare a global variable for use as Shared hook.

Example:

dioxus_shareables::shareable!(#[doc(hidden)] Var: usize = 900); // Declares a type Var which can be used to
                                                                // access the global.

fn component(cx: Scope) -> Element {
    let rw_hook = Var.use_rw(&cx);
    let w_hook = Var.use_w(&cx);
    // ...
}