Explorar el Código

remove changed log in maybe_sync memo, flush sync

Jonathan Kelley hace 1 año
padre
commit
d28cc9c0cf
Se han modificado 2 ficheros con 1 adiciones y 3 borrados
  1. 0 1
      packages/hooks/src/use_memo.rs
  2. 1 2
      packages/signals/src/signal.rs

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

@@ -58,7 +58,6 @@ pub fn use_maybe_sync_memo<R: PartialEq, S: Storage<SignalData<R>>>(
             loop {
                 // Wait for the dom the be finished with sync work
                 flush_sync().await;
-
                 rc.changed().await;
                 let new = rc.run_in(|| f());
                 if new != *state.peek() {

+ 1 - 2
packages/signals/src/signal.rs

@@ -121,9 +121,8 @@ impl<T: PartialEq + 'static> Signal<T> {
 
         spawn(async move {
             loop {
+                flush_sync().await;
                 rc.changed().await;
-                println!("changed");
-
                 let new = f();
                 if new != *state.peek() {
                     *state.write() = new;