Merge branch 'DioxusLabs:master' into add-onunmount-hook

This commit is contained in:
ealmloff authored and GitHub committed 2023-07-03 12:09:13 -07:00
commit d1cd4851aa
216 files changed
+18007 -685

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ name = "dioxus-hooks"
version = "0.3.1"
authors = ["Jonathan Kelley"]
edition = "2018"
description = "Dioxus VirtualDOM renderer for a remote webview instance"
description = "Basic useful hooks for Dioxus."
license = "MIT/Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com"
+8
View File
@@ -89,6 +89,14 @@ pub struct UseFuture<T> {
values: Rc<RefCell<Vec<*mut T>>>,
}
impl<T> Drop for UseFuture<T> {
fn drop(&mut self) {
for value in self.values.take().into_iter() {
drop(unsafe { Box::from_raw(value) })
}
}
}
pub enum UseFutureState<'a, T> {
Pending,
Complete(&'a T),