-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
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
second run of trackedFunction
seems to first re-render with old value before loading new value
#1010
Comments
The motivation here is I have other tracked functions down the line in child components that use data from the book record to then go and request further book metadata records. So when it re-renders with the old book (instead of going to isPending), it goes and triggers the child component's tracked functions for the old metadata requests again. (I've made sure to exclude this as the cause from my testing though by completely removing the child component) |
@NullVoxPopuli do you know if this is expected behaviour or a bug? Or is this more of an issue with the underlying ember-async-data library? I can file there instead if you like |
trackedFunction
seems to first re-render with old valuetrackedFunction
seems to first re-render with old value before new value
trackedFunction
seems to first re-render with old value before new valuetrackedFunction
seems to first re-render with old value before loading new value
Sorry i forgot to look at this! There's for the ping! I'll investigate tomorrow |
Found it was an issue with how |
I've been playing around with trackedFunction and it works great but I have noticed some odd behaviour.
I have a trackedFunction like this;
and a template like this;
On initial load with bookId 33, I get the output
So far so good, but when the QP changes (say, to bookId 27), I get this output;
It seems to re-render with the old state & value before flipping into isPending. Is this expected behaviour?
Is it specific to ember-data? (running 4.12.3)EDIT: further testing has shown this occurs for other async requests as well, not just ember-data.The text was updated successfully, but these errors were encountered: