dioxus_lib::prelude

Macro to_owned

source
macro_rules! to_owned {
    ($es:ident $(, $($rest:tt)*)?) => { ... };
    ($($deref:ident).* $(, $($rest:tt)*)?) => { ... };
    ($($deref:ident)* @ $head:ident $( . $tail:ident)+ $(, $($rest:tt)*)?) => { ... };
    ($($deref:ident)* @ $last:ident $(, $($rest:tt)*)? ) => { ... };
}
Expand description

A helper macro for cloning multiple values at once

ยงUsage


let (data) = use_signal(|| {});

let handle_thing = move |_| {
    to_owned![data, props.prop];
    spawn(async move {
        // do stuff
    });
};