implement readable and callable for all structs in the hooks crate
This commit is contained in:
1 parent
98158bdc6f
commit
ffc49530f6
13 files changed
+167
-491
No files matched your search
@@ -25,8 +25,9 @@ use futures_util::StreamExt;
|
||||
/// ```
|
||||
#[track_caller]
|
||||
pub fn use_memo<R: PartialEq>(f: impl FnMut() -> R + 'static) -> Memo<R> {
|
||||
let mut callback = use_callback(f);
|
||||
use_hook(|| Signal::memo(move || callback.call()))
|
||||
let callback = use_callback(f);
|
||||
#[allow(clippy::redundant_closure)]
|
||||
use_hook(|| Signal::memo(move || callback()))
|
||||
}
|
||||
|
||||
/// Creates a new unsync Selector with some local dependencies. The selector will be run immediately and whenever any signal it reads or any dependencies it tracks changes
|
||||
|
||||
Reference in new issue
Block a user