mirror of
https://github.com/leptos-rs/leptos
synced 2024-09-20 14:32:00 +00:00
chore: get tests in a working state
This commit is contained in:
parent
015a4b63ec
commit
7f7bba6ea3
3 changed files with 3 additions and 18 deletions
|
@ -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 = []
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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<i32>) -> 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,
|
||||
|
|
Loading…
Reference in a new issue