Fix memo dirty flag after unrelated writes (#2992)

* Fix memo dirty flag after unrelated writes

* improve regression test

* Update packages/signals/tests/memo.rs

Co-authored-by: Matt Hunzinger <matt@hunzinger.me>

* Update packages/signals/tests/memo.rs

Co-authored-by: Matt Hunzinger <matt@hunzinger.me>

* Update packages/signals/tests/memo.rs

Co-authored-by: Matt Hunzinger <matt@hunzinger.me>

---------

Co-authored-by: Matt Hunzinger <matt@hunzinger.me>
This commit is contained in:
Evan AlmloffandMatt Hunzinger authored and GitHub committed 2024-10-01 15:47:54 +00:00
1 parent 5925f3c8ee
commit d1c84d9a25
4 files changed
+163 -130

No files matched your search

+4 -3
View File
@@ -139,10 +139,11 @@ impl<T: 'static> Memo<T> {
drop(peak);
let mut copy = self.inner;
copy.set(new_value);
update_write
.dirty
.store(false, std::sync::atomic::Ordering::Relaxed);
}
// Always mark the memo as no longer dirty even if the value didn't change
update_write
.dirty
.store(false, std::sync::atomic::Ordering::Relaxed);
}
/// Get the scope that the signal was created in.