From 7f7bba6ea39df4f8230721d3ac8bf603007382ea Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Sat, 11 May 2024 17:18:47 -0400 Subject: [PATCH] chore: get tests in a working state --- reactive_graph/Cargo.toml | 3 ++- reactive_graph/src/lib.rs | 1 + reactive_graph/src/wrappers.rs | 17 ----------------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/reactive_graph/Cargo.toml b/reactive_graph/Cargo.toml index e18783447..8ce5cfa14 100644 --- a/reactive_graph/Cargo.toml +++ b/reactive_graph/Cargo.toml @@ -21,13 +21,14 @@ slotmap = "1" thiserror = "1" tracing = { version = "0.1", optional = true } guardian = "1" +async-lock = "3.3.0" [target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies] web-sys = "0.3" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "time", "macros"] } -any_spawner = { workspace = true, features = ["tokio"] } +any_spawner = { workspace = true, features = ["futures-executor", "tokio"] } [features] nightly = [] diff --git a/reactive_graph/src/lib.rs b/reactive_graph/src/lib.rs index ed2f4d7b7..40597ebd2 100644 --- a/reactive_graph/src/lib.rs +++ b/reactive_graph/src/lib.rs @@ -13,6 +13,7 @@ //! nodes, because they can listen to changes in other values. //! //! ```rust +//! # any_spawner::Executor::init_futures_executor(); //! use reactive_graph::{ //! computed::ArcMemo, //! effect::Effect, diff --git a/reactive_graph/src/wrappers.rs b/reactive_graph/src/wrappers.rs index c8571c054..cf9b9d302 100644 --- a/reactive_graph/src/wrappers.rs +++ b/reactive_graph/src/wrappers.rs @@ -231,23 +231,6 @@ pub mod read { where T: Send + Sync + 'static, { - /// Wraps a derived signal, i.e., any computation that accesses one or more - /// reactive signals. - /// ```rust - /// # use leptos_reactive::*; - /// # let runtime = create_runtime(); - /// let (count, set_count) = create_signal(2); - /// let double_count = Signal::derive(move || count.() * 2); - /// - /// // this function takes any kind of wrapped signal - /// fn above_3(arg: &Signal) -> bool { - /// arg.get() > 3 - /// } - /// - /// assert_eq!(above_3(&count.into()), false); - /// assert_eq!(above_3(&double_count), true); - /// # runtime.dispose(); - /// ``` #[track_caller] pub fn derive( derived_signal: impl Fn() -> T + Send + Sync + 'static,