Преглед на файлове

Dont use suspense in dog app, remove from use_future

Jonathan Kelley преди 1 година
родител
ревизия
e751f63030
променени са 2 файла, в които са добавени 2 реда и са изтрити 6 реда
  1. 2 2
      examples/dog_app.rs
  2. 0 4
      packages/hooks/src/usefuture.rs

+ 2 - 2
examples/dog_app.rs

@@ -21,7 +21,7 @@ fn app_root(cx: Scope<'_>) -> Element {
             .await
     });
 
-    match breeds.suspend()? {
+    match breeds.value()? {
         Ok(breed_list) => cx.render(rsx! {
             div { height: "500px",
                 h1 { "Select a dog breed!" }
@@ -59,7 +59,7 @@ fn breed_pic(cx: Scope, breed: String) -> Element {
             .await
     });
 
-    match fut.suspend()? {
+    match fut.value()? {
         Ok(resp) => render! {
             div {
                 button {

+ 0 - 4
packages/hooks/src/usefuture.rs

@@ -167,10 +167,6 @@ impl<T> UseFuture<T> {
             (Some(_), None) => UseFutureState::Pending,
         }
     }
-
-    pub fn suspend(&self) -> Option<&T> {
-        todo!()
-    }
 }
 
 impl<'a, T> IntoFuture for &'a UseFuture<T> {