fix memos during suspense
This commit is contained in:
1 parent
da4d9c70e8
commit
3d7f419636
6 files changed
+71
-17
No files matched your search
@@ -37,9 +37,9 @@ fn suspended_child() -> Element {
|
||||
panic!("Non-suspended task was polled");
|
||||
});
|
||||
|
||||
// // Memos should still work like normal
|
||||
// let memo = use_memo(move || val * 2);
|
||||
// assert_eq!(memo, val * 2);
|
||||
// Memos should still work like normal
|
||||
let memo = use_memo(move || val * 2);
|
||||
assert_eq!(memo, val * 2);
|
||||
|
||||
if val() < 3 {
|
||||
let task = spawn(async move {
|
||||
|
||||
@@ -53,7 +53,7 @@ async fn running_async() {
|
||||
#[tokio::test]
|
||||
async fn yield_now_works() {
|
||||
thread_local! {
|
||||
static SEQUENCE: std::cell::RefCell<Vec<usize>> = std::cell::RefCell::new(Vec::new());
|
||||
static SEQUENCE: std::cell::RefCell<Vec<usize>> = const { std::cell::RefCell::new(Vec::new()) };
|
||||
}
|
||||
|
||||
fn app() -> Element {
|
||||
@@ -88,7 +88,7 @@ async fn yield_now_works() {
|
||||
#[tokio::test]
|
||||
async fn flushing() {
|
||||
thread_local! {
|
||||
static SEQUENCE: std::cell::RefCell<Vec<usize>> = std::cell::RefCell::new(Vec::new());
|
||||
static SEQUENCE: std::cell::RefCell<Vec<usize>> = const { std::cell::RefCell::new(Vec::new()) };
|
||||
static BROADCAST: (tokio::sync::broadcast::Sender<()>, tokio::sync::broadcast::Receiver<()>) = tokio::sync::broadcast::channel(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user