mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-23 09:09:21 -05:00
removed use_raf_fn Clone from callback
This commit is contained in:
parent
04c880a3fc
commit
19c4f00c5b
2 changed files with 6 additions and 2 deletions
|
@ -26,6 +26,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.
|
- 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`).
|
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
|
## [0.6.2] - 2023-08-03
|
||||||
|
|
||||||
### Fixes 🍕
|
### 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 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.
|
/// you have to call `resume()` before the `callback` is executed.
|
||||||
pub fn use_raf_fn(
|
pub fn use_raf_fn(
|
||||||
callback: impl Fn(UseRafFnCallbackArgs) + Clone + 'static,
|
callback: impl Fn(UseRafFnCallbackArgs) + 'static,
|
||||||
) -> Pausable<impl Fn() + Clone, impl Fn() + Clone> {
|
) -> Pausable<impl Fn() + Clone, impl Fn() + Clone> {
|
||||||
use_raf_fn_with_options(callback, UseRafFnOptions::default())
|
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.
|
/// Version of [`use_raf_fn`] that takes a `UseRafFnOptions`. See [`use_raf_fn`] for how to use.
|
||||||
pub fn use_raf_fn_with_options(
|
pub fn use_raf_fn_with_options(
|
||||||
callback: impl Fn(UseRafFnCallbackArgs) + Clone + 'static,
|
callback: impl Fn(UseRafFnCallbackArgs) + 'static,
|
||||||
options: UseRafFnOptions,
|
options: UseRafFnOptions,
|
||||||
) -> Pausable<impl Fn() + Clone, impl Fn() + Clone> {
|
) -> Pausable<impl Fn() + Clone, impl Fn() + Clone> {
|
||||||
let UseRafFnOptions { immediate } = options;
|
let UseRafFnOptions { immediate } = options;
|
||||||
|
|
Loading…
Add table
Reference in a new issue