chore: fix broken doctests in leptos_reactive

This commit is contained in:
Greg Johnston 2023-10-24 15:35:16 -04:00
parent fdd4b3d919
commit e2842ede44

View file

@ -72,16 +72,16 @@ use std::{
/// ```rust
/// # use leptos::*;
/// # let runtime = create_runtime();
/// # runtime.dispose():
/// # if false {
/// # let how_many_cats = RwSignal::new(0); let how_many_dogs = RwSignal::new(0);
/// // Single signal. `Resource` will run once initially and then every time `how_many_cats` changes
/// let async_data = create_resource(move || how_many_cats.get() , |_| async move { todo!() });
/// // Non-reactive signal. `Resource` runs only once
/// let async_data = create_resource(|| (), |_| async move { todo!() });
/// // Multiple signals. `Resource` will run once initially and then every time `how_many_cats` or `how_many_dogs` changes
/// let async_data = create_resource(move || (how_many_cats.get(), how_many_dogs.get()), |_| async move { todo!() });
/// # runtime.dispose();
/// # }
/// ```
#[cfg_attr(
any(debug_assertions, feature="ssr"),
@ -933,16 +933,16 @@ impl<S, T> SignalSet for Resource<S, T> {
/// ```rust
/// # use leptos::*;
/// # let runtime = create_runtime();
/// # runtime.dispose():
/// # if false {
/// # let how_many_cats = RwSignal::new(0); let how_many_dogs = RwSignal::new(0);
/// // Single signal. `Resource` will run once initially and then every time `how_many_cats` changes
/// let async_data = create_resource(move || how_many_cats.get() , |_| async move { todo!() });
/// // Non-reactive signal. `Resource` runs only once
/// let async_data = create_resource(|| (), |_| async move { todo!() });
/// // Multiple signals. `Resource` will run once initially and then every time `how_many_cats` or `how_many_dogs` changes
/// let async_data = create_resource(move || (how_many_cats.get(), how_many_dogs.get()), |_| async move { todo!() });
/// # runtime.dispose();
/// # }
/// ```
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct Resource<S, T>