mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-22 16:49:22 -05:00
removed use_raf_fn Clone from callback
This commit is contained in:
parent
5c79bf349e
commit
1e896a0778
2 changed files with 6 additions and 2 deletions
|
@ -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 🍕
|
||||
|
|
|
@ -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<impl Fn() + Clone, impl Fn() + Clone> {
|
||||
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<impl Fn() + Clone, impl Fn() + Clone> {
|
||||
let UseRafFnOptions { immediate } = options;
|
||||
|
|
Loading…
Add table
Reference in a new issue