Merge branch 'master' into map-signal

This commit is contained in:
Evan Almloff committed 2023-10-17 13:45:36 -05:00
commit 4b8701e3eb
55 files changed
+248 -186

No files matched your search

+24
View File
@@ -29,6 +29,30 @@ fn create_signals_global() {
}
}
#[test]
fn deref_signal() {
let mut dom = VirtualDom::new(|cx| {
render! {
for _ in 0..10 {
Child {}
}
}
});
fn Child(cx: Scope) -> Element {
let signal = Signal::new("hello world".to_string());
// You can call signals like functions to get a Ref of their value.
assert_eq!(&*signal(), "hello world");
render! {
"hello world"
}
}
let _edits = dom.rebuild().santize();
}
#[test]
fn drop_signals() {
let mut dom = VirtualDom::new(|cx| {