Live data from Hacker News

Promisees – JavaScript Promises Visualization

github.com

1–10 of 16 posts

Re: Promisees – JavaScript Promises Visualization

#2
Promises are better than being stuck in callback hell, but ES7 async functions (async/await) are way better: http://www.sitepoint.com/simplifying-asynchronous-coding-es7...

The best part: you can use it today with babel (I'm using it in browser and on node thanks to the power of webpack, babel and hot reloading).

Re: Promisees – JavaScript Promises Visualization

#4

can someone explain to me is ES7 tied to the browser version/type, or usually all the popular browsers support it out of the box? because I couldn't find any information on that

It's complicated. ES6/7 support isn't binary. But sites like this help: http://caniuse.com/

Re: Promisees – JavaScript Promises Visualization

#5
post #4

can someone explain to me is ES7 tied to the browser version/type, or usually all the popular browsers support it out of the box? because I couldn't find any information on that

It's complicated. ES6/7 support isn't binary. But sites like this help: http://caniuse.com/

http://kangax.github.io/compat-table/es6/ and http://kangax.github.io/compat-table/es7/ are particularly good for ES since it breaks out things into the nitty gritty features, providing the code samples that are tested.

Re: Promisees – JavaScript Promises Visualization

#6
post #2

Promises are better than being stuck in callback hell, but ES7 async functions (async/await) are way better: http://www.sitepoint.com/simplifying-asynchronous-coding-es7... The best part: you can use it today with babel (I'm using it in browser and on node thanks to the power of webpack, babel and hot reloading).

I agree, async/await is very nice. Though it is worth pointing out async/await is quite literally syntactic sugar on top of promises. Essentially adding language syntax for common promise idioms.

Re: Promisees – JavaScript Promises Visualization

#7
post #6
post #2

Promises are better than being stuck in callback hell, but ES7 async functions (async/await) are way better: http://www.sitepoint.com/simplifying-asynchronous-coding-es7... The best part: you can use it today with babel (I'm using it in browser and on node thanks to the power of webpack, babel and hot reloading).

I agree, async/await is very nice. Though it is worth pointing out async/await is quite literally syntactic sugar on top of promises. Essentially adding language syntax for common promise idioms.

More than just syntactic sugar. async/await changes the whole control flow of a method.

Re: Promisees – JavaScript Promises Visualization

#8
post #2

Promises are better than being stuck in callback hell, but ES7 async functions (async/await) are way better: http://www.sitepoint.com/simplifying-asynchronous-coding-es7... The best part: you can use it today with babel (I'm using it in browser and on node thanks to the power of webpack, babel and hot reloading).

async/await works with promises, it doesn't replace them.

Re: Promisees – JavaScript Promises Visualization

#9
post #6

Earlier quoted context omitted.

I agree, async/await is very nice. Though it is worth pointing out async/await is quite literally syntactic sugar on top of promises. Essentially adding language syntax for common promise idioms.

More than just syntactic sugar. async/await changes the whole control flow of a method.

You can actually get identical semantics, and almost identical syntax, by abusing ES6 generators, so it is just syntactic sugar: https://gist.github.com/callahad/b99c83d6d9fd675137b7

Re: Promisees – JavaScript Promises Visualization

#10
post #6

Earlier quoted context omitted.

I agree, async/await is very nice. Though it is worth pointing out async/await is quite literally syntactic sugar on top of promises. Essentially adding language syntax for common promise idioms.

More than just syntactic sugar. async/await changes the whole control flow of a method.

Yes, by introducing (extremely handy) syntactic sugar ;)
Post reply on HN