mirror of
https://github.com/leptos-rs/leptos
synced 2024-09-20 14:32:00 +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
|
||||
/// # 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>
|
||||
|
|
Loading…
Reference in a new issue