diff --git a/CHANGELOG.md b/CHANGELOG.md index e3e6e7e..d4d03b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The option `manual` has been renamed to `immediate` to make it more consistent with other functions. To port please note that `immediate` is the inverse of `manual` (`immediate` = `!manual`). +### Other Changes 🔥 + +- Callback in `use_raf_fn` doesn't require to be cloneable anymore + ## [0.6.2] - 2023-08-03 ### Fixes 🍕 diff --git a/src/use_raf_fn.rs b/src/use_raf_fn.rs index 237cf00..b5c6755 100644 --- a/src/use_raf_fn.rs +++ b/src/use_raf_fn.rs @@ -35,14 +35,14 @@ use wasm_bindgen::JsCast; /// You can use `use_raf_fn_with_options` and set `immediate` to `false`. In that case /// you have to call `resume()` before the `callback` is executed. pub fn use_raf_fn( - callback: impl Fn(UseRafFnCallbackArgs) + Clone + 'static, + callback: impl Fn(UseRafFnCallbackArgs) + 'static, ) -> Pausable { use_raf_fn_with_options(callback, UseRafFnOptions::default()) } /// Version of [`use_raf_fn`] that takes a `UseRafFnOptions`. See [`use_raf_fn`] for how to use. pub fn use_raf_fn_with_options( - callback: impl Fn(UseRafFnCallbackArgs) + Clone + 'static, + callback: impl Fn(UseRafFnCallbackArgs) + 'static, options: UseRafFnOptions, ) -> Pausable { let UseRafFnOptions { immediate } = options;