diff --git a/packages/fermi/src/root.rs b/packages/fermi/src/root.rs index 68a5d5d33..99e97bfbb 100644 --- a/packages/fermi/src/root.rs +++ b/packages/fermi/src/root.rs @@ -13,8 +13,8 @@ use crate::Readable; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct AtomId { - pub(crate) ptr: *const (), - pub(crate) type_id: TypeId, + pub ptr: *const (), + pub type_id: TypeId, } pub struct AtomRoot { diff --git a/packages/hooks/src/usefuture.rs b/packages/hooks/src/usefuture.rs index df34a6433..f540e0a6e 100644 --- a/packages/hooks/src/usefuture.rs +++ b/packages/hooks/src/usefuture.rs @@ -143,22 +143,21 @@ impl UseFuture { self.task.get() } - /// Get the current stateof the future. + /// Get the current state of the future. pub fn state(&self) -> UseFutureState { - todo!() - // match (&self.task.get(), &self.value) { - // // If we have a task and an existing value, we're reloading - // (Some(_), Some(val)) => UseFutureState::Reloading(val), + match (&self.task.get(), &self.value()) { + // If we have a task and an existing value, we're reloading + (Some(_), Some(val)) => UseFutureState::Reloading(val), - // // no task, but value - we're done - // (None, Some(val)) => UseFutureState::Complete(val), + // no task, but value - we're done + (None, Some(val)) => UseFutureState::Complete(val), - // // no task, no value - something's wrong? return pending - // (None, None) => UseFutureState::Pending, + // no task, no value - something's wrong? return pending + (None, None) => UseFutureState::Pending, - // // Task, no value - we're still pending - // (Some(_), None) => UseFutureState::Pending, - // } + // Task, no value - we're still pending + (Some(_), None) => UseFutureState::Pending, + } } }