mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 14:54:16 +00:00
chore: fix broken doctests in leptos_reactive
This commit is contained in:
parent
fdd4b3d919
commit
e2842ede44
1 changed files with 6 additions and 6 deletions
|
@ -72,16 +72,16 @@ use std::{
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use leptos::*;
|
/// # use leptos::*;
|
||||||
/// # let runtime = create_runtime();
|
/// # 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
|
/// // 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!() });
|
/// let async_data = create_resource(move || how_many_cats.get() , |_| async move { todo!() });
|
||||||
|
|
||||||
/// // Non-reactive signal. `Resource` runs only once
|
/// // Non-reactive signal. `Resource` runs only once
|
||||||
/// let async_data = create_resource(|| (), |_| async move { todo!() });
|
/// 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
|
/// // 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!() });
|
/// let async_data = create_resource(move || (how_many_cats.get(), how_many_dogs.get()), |_| async move { todo!() });
|
||||||
/// # runtime.dispose();
|
/// # runtime.dispose();
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
any(debug_assertions, feature="ssr"),
|
any(debug_assertions, feature="ssr"),
|
||||||
|
@ -933,16 +933,16 @@ impl<S, T> SignalSet for Resource<S, T> {
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use leptos::*;
|
/// # use leptos::*;
|
||||||
/// # let runtime = create_runtime();
|
/// # 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
|
/// // 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!() });
|
/// let async_data = create_resource(move || how_many_cats.get() , |_| async move { todo!() });
|
||||||
|
|
||||||
/// // Non-reactive signal. `Resource` runs only once
|
/// // Non-reactive signal. `Resource` runs only once
|
||||||
/// let async_data = create_resource(|| (), |_| async move { todo!() });
|
/// 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
|
/// // 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!() });
|
/// let async_data = create_resource(move || (how_many_cats.get(), how_many_dogs.get()), |_| async move { todo!() });
|
||||||
/// # runtime.dispose();
|
/// # runtime.dispose();
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Debug, PartialEq, Eq, Hash)]
|
#[derive(Debug, PartialEq, Eq, Hash)]
|
||||||
pub struct Resource<S, T>
|
pub struct Resource<S, T>
|
||||||
|
|
Loading…
Reference in a new issue