mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 04:33:06 +00:00
simplify memo test failure
This commit is contained in:
parent
48751d2f98
commit
78ef453888
1 changed files with 6 additions and 6 deletions
|
@ -25,13 +25,13 @@ fn memos_rerun() {
|
|||
counter.borrow_mut().component += 1;
|
||||
|
||||
let mut signal = use_signal(|| 0);
|
||||
let memo = use_hook(move || {
|
||||
let memo = use_memo({
|
||||
to_owned![counter];
|
||||
Signal::memo(move || {
|
||||
move || {
|
||||
counter.borrow_mut().effect += 1;
|
||||
println!("Signal: {:?}", signal);
|
||||
signal()
|
||||
})
|
||||
}
|
||||
});
|
||||
assert_eq!(memo(), 0);
|
||||
signal += 1;
|
||||
|
@ -101,13 +101,13 @@ fn memos_prevents_component_rerun() {
|
|||
let signal = props.signal;
|
||||
counter.borrow_mut().component += 1;
|
||||
|
||||
let memo = use_hook(move || {
|
||||
let memo = use_memo({
|
||||
to_owned![counter];
|
||||
Signal::memo(move || {
|
||||
move || {
|
||||
counter.borrow_mut().memo += 1;
|
||||
println!("Signal: {:?}", signal);
|
||||
signal()
|
||||
})
|
||||
}
|
||||
});
|
||||
match generation() {
|
||||
0 => {
|
||||
|
|
Loading…
Reference in a new issue