This PR renames the take method on signals to manually_drop to make it easier to find and restore local lifetime tracking for signals.
Note while local lifetime tracking can help prevent some bugs at compile time, it can make some common situations less ergonomic including matching the value of a resource:
// fut.read() now causes an error
match fut.read_unchecked().as_ref() {
Some(Ok(resp)) => rsx! {
button { onclick: move |_| fut.restart(), "Click to fetch another doggo" }
div { img { max_width: "500px", max_height: "500px", src: "{resp.message}" } }
},
Some(Err(_)) => rsx! { div { "loading dogs failed" } },
None => rsx! { div { "loading dogs..." } },
}
This PR renames the
take
method on signals tomanually_drop
to make it easier to find and restore local lifetime tracking for signals.Note while local lifetime tracking can help prevent some bugs at compile time, it can make some common situations less ergonomic including matching the value of a resource:
Closes https://github.com/DioxusLabs/dioxus/issues/2011 Closes https://github.com/DioxusLabs/dioxus/issues/2009