From 38bdab880d6251591592507200047e7400c919cc Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Fri, 2 Feb 2024 15:00:05 -0600 Subject: [PATCH] only give out a ReadOnlySignal from async resources --- packages/hooks/src/use_resource.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hooks/src/use_resource.rs b/packages/hooks/src/use_resource.rs index 427334e14..807927450 100644 --- a/packages/hooks/src/use_resource.rs +++ b/packages/hooks/src/use_resource.rs @@ -95,8 +95,8 @@ impl AsyncMemo { /// Return any value, even old values if the future has not yet resolved. /// /// If the future has never completed, the returned value will be `None`. - pub fn value(&self) -> Option> { - self.value.cloned() + pub fn value(&self) -> Option> { + self.value.cloned().map(|sig| sig.into()) } /// Get the ID of the future in Dioxus' internal scheduler