Pārlūkot izejas kodu

chore: move macros around

Jonathan Kelley 3 gadi atpakaļ
vecāks
revīzija
e51b47d1fb
2 mainītis faili ar 25 papildinājumiem un 25 dzēšanām
  1. 23 0
      packages/core/src/lib.rs
  2. 2 25
      packages/hooks/src/lib.rs

+ 23 - 0
packages/core/src/lib.rs

@@ -102,3 +102,26 @@ pub(crate) mod unsafe_utils {
         std::mem::transmute(node)
     }
 }
+
+#[macro_export]
+/// A helper macro for using hooks in async environements.
+///
+/// # Usage
+///
+///
+/// ```
+/// let (data) = use_ref(&cx, || {});
+///
+/// let handle_thing = move |_| {
+///     to_owned![data]
+///     cx.spawn(async move {
+///         // do stuff
+///     });
+/// }
+/// ```
+macro_rules! to_owned {
+    ($($es:ident),+) => {$(
+        #[allow(unused_mut)]
+        let mut $es = $es.to_owned();
+    )*}
+}

+ 2 - 25
packages/hooks/src/lib.rs

@@ -16,28 +16,5 @@ pub use usecoroutine::*;
 mod usefuture;
 pub use usefuture::*;
 
-mod useeffect;
-pub use useeffect::*;
-
-#[macro_export]
-/// A helper macro for using hooks in async environements.
-///
-/// # Usage
-///
-///
-/// ```
-/// let (data) = use_ref(&cx, || {});
-///
-/// let handle_thing = move |_| {
-///     to_owned![data]
-///     cx.spawn(async move {
-///         // do stuff
-///     });
-/// }
-/// ```
-macro_rules! to_owned {
-    ($($es:ident),+) => {$(
-        #[allow(unused_mut)]
-        let mut $es = $es.to_owned();
-    )*}
-}
+// mod usesuspense;
+// pub use usesuspense::*;