rsvp.js icon indicating copy to clipboard operation
rsvp.js copied to clipboard

Make example code import and use the right modules in the right way

Open ohcibi opened this issue 5 years ago • 3 comments

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.

ohcibi avatar Mar 18 '20 11:03 ohcibi

If the imports aren't working, that sounds like a bug. That should be fixed.

stefanpenner avatar Mar 30 '20 19:03 stefanpenner

@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?).

ohcibi avatar Mar 30 '20 20:03 ohcibi

I see, the goal is for the default export to be Promise but due to compat it is a complex object with many properties..

stefanpenner avatar Apr 01 '20 15:04 stefanpenner