You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that use_debounce returns a callback in a triggered state. That is, after the given time elapses the original callback is invoked whether or not the debounced version was ever invoked. This is not the behavior that I would expect. Is this the desired behavior for this hook?
The following code demonstrates:
use gloo_console::log;use yew::prelude::*;use yew_hooks::use_debounce;#[function_component(App)]fnapp() -> Html{let f = use_debounce(|| {log!("this should never print, but it does");},1000);html!{}}fnmain(){
yew::Renderer::<App>::new().render();}
The text was updated successfully, but these errors were encountered:
It seems that
use_debounce
returns a callback in a triggered state. That is, after the given time elapses the original callback is invoked whether or not the debounced version was ever invoked. This is not the behavior that I would expect. Is this the desired behavior for this hook?The following code demonstrates:
The text was updated successfully, but these errors were encountered: