-
Notifications
You must be signed in to change notification settings - Fork 262
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
RSVP doesn't work right with 'await' #500
Comments
No, in an ember app it requires an RSVP promise because RSVP is monkey patched to handle an ember run loop. Native promise do not have this. There is history concerning this at emberjs/rfcs#175 but unfortunately it is unlikely to have a solution. Good news is that there is a very usable and helpful workaround with the ember-co addon which works great for this very use case. |
I don't believe this can be changed currently. @boris-petrov can you provide a runnable example? I will gladly debug if one is provide |
@stefanpenner - about the first thing - isn't doing a: import { Promise } from 'rsvp'
export default
name: 'promise'
initialize: ->
window.Promise = Promise Doing exactly that? About the second thing - I really tried hard reproducing the problem but could not find a short version (or one that I can publish). :( I currently don't have the time to try again. If you prefer, you could close the issue and I will create a new one if/when I manage with a reproduction. Or hopefully the problem just goes away by itself. |
I don't believe so, not with Native AsyncAwait at-least (potentially though with polyfills) |
Unfortunately I think I will need to. I tried some experiments and was also unable to find an issue... |
I've been struggling with an issue we have for the past few days. It seems to go away when I don't use
await
with RSVP.all
/hash
. I still cannot create a reproduction (will post it here if I manage) but we do something like:The issue in our case is that
done awaiting
is printed beforeresolved
. In this test case it doesn't but in our code it does. :) That is, when thewait
method is called,@loading
contains the two promises that were set infindHelper
but awaiting them doesn't actually do that.If we change the 2
await
s to.then
s then it works fine. Can you see anything wrong that we should not be doing?Another question - awaiting a promise returns a native promise rather than an RSVP one. This is in the context of an Ember app. Can this be changed somehow?
The text was updated successfully, but these errors were encountered: