We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug When updating more than one query_signal in the same closure, only the last write has an effect.
Leptos Dependencies
leptos = { version = "0.6", features = ["csr", "nightly"] } leptos_meta = { version = "0.6", features = ["csr", "nightly"] } leptos_router = { version = "0.6", features = ["csr", "nightly"] }
To Reproduce Steps to reproduce the behavior:
query_signal
Expected behavior Writes to each query_signal has an immediate effect.
Additional context Additionally, it is clear that writes to a query_signal do not take effect until after the closure has run.
Minimal example
#[component] pub fn TestQuery() -> impl IntoView { let (r_from, w_from) = create_query_signal::<String>("from"); let (r_to, w_to) = create_query_signal::<String>("to"); let switch = move |_| { log!("Before from: {:?}", r_from()); log!("Before to: {:?}", r_to()); w_from(r_to()); w_to(None); log!("After from: {:?}", r_from()); log!("After to: {:?}", r_to()); }; view! { <div class="flex flex-col gap-4 p-8"> <div>Current from: {r_from}</div> <div>Current to: {r_to}</div> <button type="button" on:click=switch class="btn"> Switch </button> </div> } }
Output after first click:
Before from: Some("Original from") Before to: Some("Original to") After from: Some("Original from") After to: Some("Original to")
Output after second click:
Before from: Some("Original from") Before to: None After from: Some("Original from") After to: None
This should support the idea that 1) The last write "wins" and 2) Writes do not take immediate effect.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
When updating more than one query_signal in the same closure, only the last write has an effect.
Leptos Dependencies
To Reproduce
Steps to reproduce the behavior:
query_signal
sExpected behavior
Writes to each
query_signal
has an immediate effect.Additional context
Additionally, it is clear that writes to a
query_signal
do not take effect until after the closure has run.Minimal example
Output after first click:
Output after second click:
This should support the idea that 1) The last write "wins" and 2) Writes do not take immediate effect.
The text was updated successfully, but these errors were encountered: