fix: improving tick logic in any_spawner

This commit is contained in:
Saber Haj Rabiee
2025-03-28 23:51:49 -07:00
parent ab0832ad68
commit 9d2ac0a18f
6 changed files with 18 additions and 25 deletions

View File

@@ -1025,6 +1025,8 @@ mod tests {
#[tokio::test]
async fn patching_only_notifies_changed_field_with_custom_patch() {
_ = any_spawner::Executor::init_tokio();
#[derive(Debug, Store, Patch, Default)]
struct CustomTodos {
#[patch(|this, new| *this = new)]
@@ -1038,8 +1040,6 @@ mod tests {
completed: bool,
}
_ = any_spawner::Executor::init_tokio();
let combined_count = Arc::new(AtomicUsize::new(0));
let store = Store::new(CustomTodos {
@@ -1094,6 +1094,7 @@ mod tests {
#[tokio::test]
async fn notifying_all_descendants() {
use reactive_graph::traits::*;
_ = any_spawner::Executor::init_tokio();
#[derive(Debug, Clone, Store, Patch, Default)]

View File

@@ -251,6 +251,8 @@ mod tests {
async fn patch() {
use crate::OptionStoreExt;
_ = any_spawner::Executor::init_tokio();
#[derive(Debug, Clone, Store, Patch)]
struct Outer {
inner: Option<Inner>,
@@ -269,8 +271,6 @@ mod tests {
}),
});
_ = any_spawner::Executor::init_tokio();
let parent_count = Arc::new(AtomicUsize::new(0));
let inner_first_count = Arc::new(AtomicUsize::new(0));
let inner_second_count = Arc::new(AtomicUsize::new(0));