rsvp.js
rsvp.js copied to clipboard
Make example code import and use the right modules in the right way
The former example where not technically wrong but pretty misleading,
since they suggested Promise (the one that can be used in
new Promise) is the default export of the rsvp package when it isn't.
Ideally when using the default import it should be called RSVP rather
then Promise but in fact neither of the code example require to use
that default export at all so I removed using that in the examples
entirely.
If the imports aren't working, that sounds like a bug. That should be fixed.
@stefanpenner this is not a bug in rsvp but an error in the documentation.
This line: https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp.js#L47
tells that the default export of rsvp is only for legacy compat, i.e. there will be no default export anymore eventually (the old RSVP which this default export resembles wasn't an alias for Promise either, wasn't it?).
I see, the goal is for the default export to be Promise but due to compat it is a complex object with many properties..