7 ms·
Didn't ES6 promise ;) to solve this?
by chx 9y ago
Didn't ES6 promise ;) to solve this?
- matthewmacleod 9y agoThis is true only insofar as libraries use promises, and your code uses promises. They're still pretty annoying in my experience. There are still some other cases where the mess of brackets is overkill, other than callback hell.
- udp 9y ago> This is true only insofar as libraries use promises, and your code uses promises. They're still pretty annoying in my experience. Promisify, or (as I prefer to) just "return new Promise((resolve, reject) => { nonPromisedStuff(...) })"? > There are still some other cases where the mess of brackets is overkill, other than callback hell. Like bad coding style?
- roblabla 9y agoI'm awaiting ES7 :D for the true solution to this problem. It'll eliminate the boilerplate of .then(function() {})` entirely. Less brackets, less ceremony.
- jholman 9y agoES7 was finalized a year ago. Everything except IE 11 supports all of it. You meant ES2017. HTH
- masklinn 9y agoAnd all current browsers save IE11 support ES2017 async functions.
- zajd 9y agoIsn't ES6 `.then(()=>{})` ?
- deleted 9y ago[deleted]
- ravenstine 9y agoOr even without curly braces: `.then(x => doSomethingWith(x));`