瀏覽代碼

Fix compile

Jonathan Kelley 1 年之前
父節點
當前提交
8cc17dc1bd

+ 1 - 1
packages/hooks/src/use_future.rs

@@ -1,5 +1,5 @@
 #![allow(missing_docs)]
 #![allow(missing_docs)]
-use crate::use_hook_did_run;
+use crate::{use_hook_did_run, use_signal};
 use dioxus_core::{
 use dioxus_core::{
     prelude::{spawn, use_drop, use_hook},
     prelude::{spawn, use_drop, use_hook},
     Task,
     Task,

+ 1 - 1
packages/hooks/src/use_memo.rs

@@ -3,8 +3,8 @@ use dioxus_signals::{CopyValue, ReadOnlySignal, Readable, Signal, SignalData};
 use dioxus_signals::{Storage, Writable};
 use dioxus_signals::{Storage, Writable};
 // use generational_box::Storage;
 // use generational_box::Storage;
 
 
+use crate::use_signal;
 use crate::{dependency::Dependency, use_hook_did_run};
 use crate::{dependency::Dependency, use_hook_did_run};
-use dioxus_signals::use_signal;
 // use dioxus_signals::{signal::SignalData, ReadOnlySignal, Signal};
 // use dioxus_signals::{signal::SignalData, ReadOnlySignal, Signal};
 
 
 /// Creates a new unsync Selector. The selector will be run immediately and whenever any signal it reads changes.
 /// Creates a new unsync Selector. The selector will be run immediately and whenever any signal it reads changes.

+ 1 - 0
packages/hooks/src/use_resource.rs

@@ -1,4 +1,5 @@
 #![allow(missing_docs)]
 #![allow(missing_docs)]
+use crate::use_signal;
 use dioxus_core::{
 use dioxus_core::{
     prelude::{spawn, use_hook},
     prelude::{spawn, use_hook},
     ScopeState, Task,
     ScopeState, Task,

+ 1 - 1
packages/hooks/src/use_signal.rs

@@ -96,7 +96,7 @@ fn use_maybe_signal_sync<T: 'static, U: Storage<SignalData<T>>>(
 
 
     // By default, we want to unsubscribe the current component from the signal on every render
     // By default, we want to unsubscribe the current component from the signal on every render
     // any calls to .read() in the body will re-subscribe the component to the signal
     // any calls to .read() in the body will re-subscribe the component to the signal
-    use_before_render(|| signal.unsubscribe(current_scope_id().unwrap()));
+    use_before_render(move || signal.unsubscribe(current_scope_id().unwrap()));
 
 
     signal
     signal
 }
 }