You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect that when the signal is assigned a new value, the UI refreshes before useTask$ blocks. That is, when we do:
text.value = "new value";
I'd expect UI elements that use text.value to be updated before track() makes useTask$ run and blocks rendering.
Otherwise, it is almost as if the assignment itself is blocked until useTask$ returns, while the expectation is that the assignment takes place first, and only then, because a new value was already assigned, does track() wake up and runs useTask$.
In the playground I set up, type 3 characters into the text box. When 3 characters are typed, we assign them to text.value. At this point, we'd expect <p>Text = {text.value}</p> to be updated, and useTask$ to run (because it is tracking text.value). But instead, useTask$ is called and blocks (for 5 seconds in my example), and only then the UI reacts to the change in text.value.
Which component is affected?
Qwik Runtime
Describe the bug
When tracking a signal inside useTask$, e.g.:
I would expect that when the signal is assigned a new value, the UI refreshes before
useTask$
blocks. That is, when we do:I'd expect UI elements that use
text.value
to be updated beforetrack()
makesuseTask$
run and blocks rendering.Otherwise, it is almost as if the assignment itself is blocked until
useTask$
returns, while the expectation is that the assignment takes place first, and only then, because a new value was already assigned, doestrack()
wake up and runsuseTask$
.Reproduction
https://qwik.dev/playground/#f=7VZNi8IwEL37K0JZaBaCFJZFdpfsX%2FDiXQQrFkQF66nkv%2FveTPPhx82TYC4N6TSTTt689wrQzGY%2Fj0DjsvrKVHjtaSSNdSF2UZeUwdY1zpVeo08p5HcBjEjSreRiB1HjkDMY1ecxKTNN0bPnVhOYUSqExex30zRxXZNqLFLnD%2BU9gY7H1f0Z8Uix8ugOIasedgYatl3hFFDh0y87JQV1YlEOe7EqH36wS2faXXl6jm5j251mn4487r03XwrbNEqnUy1u8jrqdk%2FzlX%2FF9AdTVy7u7UxVww6saXioQowFHS94O5uuhfJBvqFz%2BEqtQhWLpaPY2OMvinLpCHEaQoakFErvf8gbhKsqHf%2FnEQJDeS9FlBpTzologmMyUfSoQKHrKLxS2cIXWAthlcXsargETmL059%2BbzV6PzS4
Steps to reproduce
In the playground I set up, type 3 characters into the text box. When 3 characters are typed, we assign them to
text.value
. At this point, we'd expect<p>Text = {text.value}</p>
to be updated, anduseTask$
to run (because it is trackingtext.value
). But instead,useTask$
is called and blocks (for 5 seconds in my example), and only then the UI reacts to the change intext.value
.System Info
Additional Information
No response
The text was updated successfully, but these errors were encountered: