Macro maple_core::cloned[][src]

macro_rules! cloned {
    (($($arg:ident),*) => $e:expr) => { ... };
}

Utility macro for cloning all the arguments and expanding the expression.

Temporary workaround for Rust RFC #2407.

Example

use maple_core::prelude::*;

let state = Signal::new(0);

create_effect(cloned!((state) => move || {
   state.get();
}));

// state still accessible outside of the effect
let _ = state.get();