-
Notifications
You must be signed in to change notification settings - Fork 24
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
Data flickers when promise changes #15
Comments
I think this would be a confusing thing in the error scenario. If you want to avoid flickering you could always use |
But maybe this could work out, I'm not sure of the implications yet. |
@fivetanley I found a better way to do this with |
Awesome, I wish we could depend on ember concurrency |
Why can't we? |
Don't want to bring in the large runtime dependency |
Right... |
When more browsers support generators out of the box, I definitely would love to reconsider, but regenerator/babel can be huge... Maybe we can change the implementation here to have this behavior after thinking about it for a bit. |
Might be as simple as |
|
on recompute, to only call it once |
Hmm... ok, not sure how that'll look :) |
I too would like to see this working without needing to introduce a task into the mix. Right now I have to schedule ember-concurrency tasks to run in didRecieveAttrs just to avoid this flicker when passed values trigger computed property changes in a promise based list. Would be awesome if this didn't happen. I tried making the quick edit that @fivetanley suggested in await.js, but I get errors and I don't know enough about the runLoop to compensate for them. Adding a loading indicator is sort of a solution but then it just flickers to the loader and then back to the list. |
Let's say we have a model // app/models/foo.js
bar: DS.belongsTo('bar') I tried logging the following in a template: {{log foo.bar.isPending (is-pending foo.bar)}} When I refreshed the page, both logged as
@fivetanley, Would it be appropriate for that condition to compare |
@magistrula do you have a video demonstration of the bug? That solution sounds on the right track to me but I'd like to understand the bug a bit better. |
@fivetanley, I set up this twiddle reproducing the issue. If you have the console open, you'll see the log statements I was referring to. I also included logs in the |
This still is kind of a bummer. Anything I can do to help here? |
@DavidPhilip if you want to take a stab at a bugfix PR + test that would be really helpful, I haven't noticed this in our apps. |
If you consider this scenario,
When the promise changes, the result of
(await promise)
changes to null while the promise is unfulfilled. This causes the list to be torn down while promise is resolving. Instead, it should continue to show the last value until the promise is resolved.Thoughts?
The text was updated successfully, but these errors were encountered: