ember-learn / ember-jsonapi-docs

fixes up the ember docs generated by YUIDoc to be in JSONAPI format + some other niceties
9 stars 11 forks source link

refactor promises to async-await #29

Closed MartinMalinda closed 5 years ago

MartinMalinda commented 7 years ago

I think refactoring promises to async await could improve code readability in this scenario.

I've wanted to do this in the past and did some basic refactor of index.js (https://github.com/MartinMalinda/ember-jsonapi-docs/blob/master/index.js) but got distracted by other work back then and did not finish it.

If you think this is a good idea I can send a PR.

sivakumar-kailasam commented 7 years ago

Thanks for taking the time to try this out. With LTS the es6 features we use atm work without the need of babel. Debugging transpiled code is probably the other side of this that we'd probably have to consider.

Would love to hear @acorncom's thoughts :)

MartinMalinda commented 7 years ago

I googled a bit and it seems like async-await landed in Node 7 but under a feature flag, so it's not production ready yet.

On the other hand, generators are in Node for quite some time and they could be used for basically the same thing, even if the syntax is not that nice.

sivakumar-kailasam commented 7 years ago

I personally use async await in all my code at work 😄. Thought of keeping things simple here.

acorncom commented 7 years ago

Having this system using async / await sounds great. However while we're making the "big push" I'd suggest we wait on adding niceties like that unless they really help with the code we're building ...

MartinMalinda commented 7 years ago

ok, I agree. I can return to this later.

toddjordan commented 5 years ago

Closed while on hold. Feel free to submit a PR if anyone wants to make this happen.