Macro sycamore_reactive::cloned [−][src]
macro_rules! cloned {
(($($arg : ident), *) => $e : expr) => { ... };
}
Expand description
Utility macro for cloning all the arguments and expanding the expression.
Temporary workaround for Rust RFC #2407.
Example
use sycamore_reactive::*;
let state = Signal::new(0);
create_effect(cloned!((state) => move || {
state.get();
}));
// state still accessible outside of the effect
let _ = state.get();