
Promisees – JavaScript Promises Visualization - bevacqua
https://github.com/bevacqua/promisees
======
iyn
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...](http://www.sitepoint.com/simplifying-asynchronous-
coding-es7-async-functions/)

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

~~~
iamstef
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.

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

~~~
callahad
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](https://gist.github.com/callahad/b99c83d6d9fd675137b7)

~~~
conical
Does the phrase "syntactic sugar" have any meaning? Name a new language
feature that "it is just syntactic sugar" can't be applied to.

~~~
callahad
Sure, ES6 WeakMap and WeakSet can't be implemented without native support in
the runtime.

Or, for that matter, const. Though perhaps const is just syntatic sugar for
not reassigning to the same darn name? ;)

~~~
conical
Const is a pretty good example, the closest I can think to emulating it in es5
is something like:

Object.defineProperty(this, 'five', { enumerable: true, writable: false,
value: 5, configurable: false });

If in global scope, 'five' will look like a const.

WeakMap and WeakSet have polyfills with minor caveats.

I guess you're defining language features as not "syntactic sugar" if they
can't be absolutely 100% polyfilled.

------
finalight
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

~~~
curun1r
It's complicated. ES6/7 support isn't binary. But sites like this help:
[http://caniuse.com/](http://caniuse.com/)

~~~
asutherland
[http://kangax.github.io/compat-table/es6/](http://kangax.github.io/compat-
table/es6/) and [http://kangax.github.io/compat-
table/es7/](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.

