fix effects
This commit is contained in:
1 parent
466005890d
commit
7daa945ae3
2 files changed
+5
-3
No files matched your search
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user