use_callback

Function use_callback 

Source
pub fn use_callback<'a, T, R>(
    cx: ScopeState<'a>,
    f: impl FnMut(T) -> R + 'a,
) -> &'a Rc<dyn Fn(T) -> R + 'a>
where T: 'static, R: 'static,
Expand description

Use a callback function. The returned function will be updated to f whenever this component is re-composed.