use CapturedError as dioxus::Ok() so resources still function as expected (#4851)
This commit is contained in:
1 parent
9f0bacc85c
commit
281f68faf5
14 files changed
+200
-54
No files matched your search
@@ -61,7 +61,7 @@ use {
|
||||
pub fn use_websocket<
|
||||
In: 'static,
|
||||
Out: 'static,
|
||||
E: Into<dioxus_core::Error> + 'static,
|
||||
E: Into<CapturedError> + 'static,
|
||||
F: Future<Output = Result<Websocket<In, Out, Enc>, E>> + 'static,
|
||||
Enc: Encoding,
|
||||
>(
|
||||
@@ -72,7 +72,7 @@ pub fn use_websocket<
|
||||
let status_read = use_hook(|| ReadSignal::new(status));
|
||||
|
||||
let connection = use_resource(move || {
|
||||
let connection = connect_to_websocket().map_err(|e| CapturedError::from(e.into()));
|
||||
let connection = connect_to_websocket().map_err(|e| e.into());
|
||||
async move {
|
||||
let connection = connection.await;
|
||||
|
||||
|
||||
Reference in new issue
Block a user