> On Sep 27, 2016, at 5:23 PM, Li Xiaolong <[email protected]> wrote: > > Sorry I’m not familiar with es7. But I still thing my OMP is better than > async/await. > 1: the await keyword can only be used in an async function, so each time you > want to await you have to add async before outer function.
That’s not necessarily true — `await` in modules may be very different from this. > 2: async/await still use promise to handle async, which is not as clear as my > OMP that only use functions. The reject state of the promise became redundant > since await never gets it. You might be confused about something — if an awaited Promise is rejected, the async function can be resumed from a catch block to handle the rejection. > 3: the async function calls identically with sync functions, makes it hard to > check out if the function is async without jumping to the definition. But OMP > can easily be recognized. I’m not sure everyone shares this view — many people laud other languages where coroutines (for example) are indistinguishable from regular subroutines. > 4: it’s complex for async/await to handle deep async callbacks. How? > _______________________________________________ > es-discuss mailing list > [email protected] <mailto:[email protected]> > https://mail.mozilla.org/listinfo/es-discuss > <https://mail.mozilla.org/listinfo/es-discuss>
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

