Clean up a number of examples
This commit is contained in:
30 files changed
+284
-413
No files matched your search
@@ -7,8 +7,11 @@ use std::{
|
||||
};
|
||||
|
||||
use dioxus_core::{
|
||||
prelude::{current_scope_id, has_context, provide_context, schedule_update_any},
|
||||
use_hook, ScopeId,
|
||||
prelude::{
|
||||
current_scope_id, has_context, provide_context, schedule_update_any, use_hook,
|
||||
IntoAttributeValue,
|
||||
},
|
||||
ScopeId,
|
||||
};
|
||||
use generational_box::{GenerationalRef, GenerationalRefMut};
|
||||
|
||||
@@ -306,6 +309,15 @@ impl<T: 'static> Signal<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> IntoAttributeValue for Signal<T>
|
||||
where
|
||||
T: Clone + IntoAttributeValue,
|
||||
{
|
||||
fn into_value(self) -> dioxus_core::AttributeValue {
|
||||
self.with(|f| f.clone().into_value())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Clone + 'static> Signal<T> {
|
||||
/// Get the current value of the signal. This will subscribe the current scope to the signal.
|
||||
/// If the signal has been dropped, this will panic.
|
||||
|
||||
Reference in new issue
Block a user