From e2842ede44b023944050920fb0d6183a6b4ba9bb Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Tue, 24 Oct 2023 15:35:16 -0400 Subject: [PATCH] chore: fix broken doctests in `leptos_reactive` --- leptos_reactive/src/resource.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/leptos_reactive/src/resource.rs b/leptos_reactive/src/resource.rs index 9481811f7..d1519bb39 100644 --- a/leptos_reactive/src/resource.rs +++ b/leptos_reactive/src/resource.rs @@ -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 SignalSet for Resource { /// ```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