fix effects

This commit is contained in:
Evan Almloff committed 2023-11-06 18:54:35 -06:00
1 parent 466005890d
commit 7daa945ae3
2 files changed
+5 -3

No files matched your search

+1 -1
View File
@@ -143,7 +143,7 @@ impl<T: 'static, S: Storage<T>> CopyValue<T, S> {
/// Set the value. If the value has been dropped, this will panic.
pub fn set(&self, value: T) {
*self.write() = value;
self.value.set(value);
}
/// Run a function with a reference to the value. If the value has been dropped, this will panic.
+4 -2
View File
@@ -6,8 +6,8 @@ use dioxus::prelude::*;
use dioxus_core::ElementId;
use dioxus_signals::*;
#[test]
fn effects_rerun() {
#[tokio::test]
async fn effects_rerun() {
simple_logger::SimpleLogger::new().init().unwrap();
#[derive(Default)]
@@ -40,6 +40,8 @@ fn effects_rerun() {
);
let _ = dom.rebuild().santize();
dom.render_with_deadline(tokio::time::sleep(std::time::Duration::from_millis(100)))
.await;
let current_counter = counter.borrow();
assert_eq!(current_counter.component, 1);