-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fixes #13750 update documentation to cast getJSON
to compliant promise
#13752
Conversation
Note: here's a twiddle showing that this approach works https://ember-twiddle.com/55ae031da0bfe8647440410ce9016d67 |
getJSON
to compliant promisegetJSON
to compliant promise
getJSON
to compliant promisegetJSON
to compliant promise
@@ -60,6 +60,9 @@ function tap(proxy, promise) { | |||
|
|||
When the $.getJSON completes, and the promise is fulfilled | |||
with json, the life cycle attributes will update accordingly. | |||
Note that $.getJSON doesn't return an ECMA spcified promise, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo here: s/spcified/specified/
c2b18fc
to
26879fa
Compare
@rwjblue needs your eyes |
@habdelra - 👓 |
Thank you! |
@@ -38,7 +38,7 @@ function tap(proxy, promise) { | |||
let ObjectPromiseProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin); | |||
|
|||
let proxy = ObjectPromiseProxy.create({ | |||
promise: $.getJSON('/some/remote/data.json') | |||
promise: Ember.RSVP.cast($.getJSON('/some/remote/data.json')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ember.RSVP.cast
is actually undocumented and in the source seems to be an alias to resolve
Maybe resolve is a better choice since it is documented and used in the guides.
This is from Wicked Good Ember contributing workshop in row #2 https://docs.google.com/spreadsheets/d/12lAjN5ro2UO4j30FbVtfCQgMgJaywSow8mA2OEbIIV0/edit#gid=0