macro_rules! bind { ($hook:ident: $(let $v:ident = move |$e:tt $(: $e_ty:ty)?| $body:expr;)+) => { ... }; }
Expand description
Binds a closure to a given Hook
. In practice:
bind! { count:
let increment = move |_| *count += 1;
let decrement = move |_| *count -= 1;
}
Desugars into:
let increment = count.bind(move |count, _| *count += 1);
let decrement = count.bind(move |count, _| *count -= 1);