Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
domenicd
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
27 ms
·
241.
▲
The ServiceWorker: The network layer is yours to own
(youtube.com)
2 points
by
domenicd
12y ago
|
0 comments
242.
▲
by
domenicd
12y ago
Who needs functions. Labelled gotos are not a problem if you're judicious.
243.
▲
by
domenicd
12y ago
It's fulfilled. If you return from the rejection handler, instead of rethrowing, then you have handled the error: rejectedPromise.catch(e => { return 5; }); is similar to try { throwError(); } catch (e) { return 5; }
244.
▲
by
domenicd
12y ago
Scalar variables are a good solution to tackle register problems. But once you spend a little time with Linked List Programming, You never want to go back to any scalar solution. Linked List Programming eliminates every scenario where you n
245.
▲
by
domenicd
12y ago
setImmediate works with macrotasks; promises work with microtasks. These are very different. See e.g. https://github.com/YuzuJS/setImmediate#macrotasks-and-microt... Also, note that yield/generators are entirely s
246.
▲
by
domenicd
13y ago
This is false. Bluebird does not and never will delegate to native promises.
247.
▲
by
domenicd
13y ago
Yup, from what I recall of history both Twisted Deferreds and JavaScript promises have their heritage in E's promises.
248.
▲
by
domenicd
13y ago
Notice that's in the explanatory Notes section, not the normative Requirements section.
249.
▲
by
domenicd
13y ago
> The real problem is the core NodeJS libraries aren't promise compliant. I don't know if there's a module that cleanly wraps all of these in their promise analogs but that'd be the best thing here. There's a few
250.
▲
by
domenicd
13y ago
You cannot yield from the global scope; you have to explicitly be inside a generator function. This isn't really a problem in practice except for one-off-scripts, since most modules don't have side effects but instead export funct
251.
▲
by
domenicd
13y ago
Promises are in ES6. There is a prototype version of them in V8 behind the usual --harmony flag, although it is very bad and deviates from the standard quite a lot. E.g. it passes 221/879 of the Promises/A+ tests [1], which only t
252.
▲
by
domenicd
13y ago
ES6 features are already shipping in many browsers. http://kangax.github.io/es5-compat-table/es6/
253.
▲
by
domenicd
13y ago
As a co-maintainer of Q, and author of the ES6 promise spec, this is extremely impressive work. I have had the privilege of watching it develop over the last few weeks, and am nothing short of amazed with what the author has done. The speed
254.
▲
by
domenicd
13y ago
I will speak mostly to Q, since I am a co-maintainer. Q has historically stemmed from the work of Mark Miller, one of the authors of the E programming language, from which JavaScript promises are largely inspired. As such, it aligns with hi
255.
▲
by
domenicd
13y ago
You may find https://npmjs.org/package/pr useful.
256.
▲
AngularJS from the perspective of a Backbone convert
(pelebyte.net)
8 points
by
domenicd
13y ago
|
0 comments
257.
▲
by
domenicd
13y ago
It's worth noting that C#'s async/await is based directly on promises; they are called `Task<T>` in .NET. Indeed, they share a common ancestor I believe; .NET 4.5's `Task<T>` is derived from F#'s `Async&
258.
▲
by
domenicd
13y ago
`then` is meant to return a promise, i.e. return an asynchronous value; it should never synchronously throw an error. That said, I somewhat agree (although in JavaScript it should be `undefined`, not `null`). If we were starting clean, inst
259.
▲
by
domenicd
13y ago
Oh yes, I always forget about this one because it's not on my SlideShare, but you're right, it's really excellent! Michael did a great job putting that together and I was honored he invited me to share the stage.
260.
▲
by
domenicd
13y ago
I gave a talk at JSConf US 2013 about the genesis of this spec, and how I believe it plays into the future of open, developer-driven APIs for the web platform. I hope the video is up soon, but until then, the slides are at http://
261.
▲
by
domenicd
13y ago
It's worth noting we are very close to finishing up a 1.1 revision of the spec, which clarifies a few things mainly around how promise libraries interoperate with each other's promises. You can find the work in our master branch
262.
▲
by
domenicd
13y ago
I have given several talks, for which slide decks and one video are available: http://www.slideshare.net/domenicdenicola/callbacks-promises... http://www.slideshare.net/domenicdenicola/promises-pro
263.
▲
by
domenicd
13y ago
This is actually a really good point, haha! Filed, and will fix in the upcoming so-close-to-done 1.1 revision: https://github.com/promises-aplus/promises-spec/issues/135
264.
▲
Redemption from Callback Hell
(marakana.com)
1 points
by
domenicd
13y ago
|
0 comments
265.
▲
by
domenicd
14y ago
The second `logUserName` does return a promise. And yes, you always have to keep inserting `yield` all the way up the stack; you can't "hide" the asynchronicity. I think this is good. It's important to explicitly call out the asynchronous p
266.
▲
by
domenicd
14y ago
So who do we have to pay to get this turned on by default, instead of behind a flag?
267.
▲
by
domenicd
14y ago
I'm not sure the two are related. The reason you need to rewrite your code in JS is because it lacks coroutines of any sort. That's not related to blocking using threads. As a concrete demonstrate, in ECMAScript 6, which has generators (= s
268.
▲
by
domenicd
14y ago
> RequireJS can build into a single file for production - it's dead simple to set up. Really? My experience was that it was a nightmare. Now you have to maintain yet another massive JavaScript config file (in addition to your original r
269.
▲
by
domenicd
14y ago
The values are held weakly in ES6 weak maps.
270.
▲
Real-World Windows 8 Apps in JavaScript
(youtube.com)
4 points
by
domenicd
14y ago
|
0 comments
More ›