Merge branch 'DioxusLabs:master' into add-onunmount-hook
This commit is contained in:
216 files changed
+18007
-685
No files matched your search
@@ -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"
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in new issue
Block a user