Layering: Fix the jobs infrastructure Presenter: Daniel Ehrenberg Author: Domenic Denicola June 2019 TC39 meeting
Layering: Fix the jobs infrastructure Presenter: Daniel Ehrenberg Author: Domenic Denicola June 2019 TC39 meeting
Promises have always been extremely contentious in JS for a couple reasons and Domenic has had the patience of a saint getting the original proposal through so it's totally understandable that he might not want to deal with this anymore especially if people in his org are against it.There were a couple reasons the original promises were so contentious to standardize. - Monads: there was a very voc
TC39 member here.cwmma gets a lot right here: Promises have always been contentious in JS (and TC39) and Domenic has indeed had the patience of a saint attempting to wrangle the various points of view into a coherent proposal. TC39 as a group is generally very motivated to find positive-sum outcomes and find solutions that address everyone's constraints in a satisfactory way. That doesn't usually
(2015/10/21追記) 記事を書いてから半年経ちましたが、最近はRxの良さを理解したり、ES7のasync/awaitがbabelによって実用的になりつつあったり等、またもやベストプラクティスとはなんだったのか状態です。とはいえ、いまのところPromiseは非同期処理の土台であり続けそうですし、Generatorもasync/awaitへの足がかりとして知っておくことのメリットは大きいかと思いますので、引き続き公開させたままとさせて頂きます。 (追記ここまで) 数ある非同期処理のプラクティスを試してみて、だいたいこれが良いんじゃないかというパターンが固まったので書きます。効用はコールバック地獄からの脱出と結局非同期どれが良いの感の払拭。ES6寄りです。 前提知識 JavaScript Promiseの本 http://azu.github.io/promises-book/ ジェネレ
node --harmony-generators script.jsSlides: pag.forbesl.co.uk Sequence 1function count(n){ var res = [] for (var x = 0; x < n; x++) { res.push(x) } return res } for (var x of count(5)) { console.log(x) } Sequence 2function count(){ var res = [] for (var x = 0; true; x++) { res.push(x) } return res } for (var x of count()) { console.log(x) } Sequence 3function* count(){ for (var x = 0; true; x++) {
下のようなコードが、親しみをこめて「コールバック地獄」とか「死のピラミッド」とか呼ばれているのはご存じですよね。 doAsync1(function () { doAsync2(function () { doAsync3(function () { doAsync4(function () { }) }) }) この状態がコールバック地獄かどうかは、意見の分かれるところでしょう。ネストがいくら深くても全く問題がないコードもあるからです。非同期のコードでフロー管理ができないほど複雑になってしまった場合は悪夢ですが。自分のコードがどの程度”ひどい”状態に陥っているかを確認するには、こう自問してみてください。「 doAsync1 の前に doAsync2 が実行された場合、リファクタリングにどこまで労力がかけられるか」と。ここでのゴールはネストの階層を減らすことではなく、モジュール化された(も
As a heads up, there's some debate around the fetch() API how exactly request termination should work and how that affects promises: slightlyoff/ServiceWorker#625 The WebRTC WG has also been discussing canceling in the context of terminating a request for permission from the user. I think they decided to postpone for now until there's a bit more progress on what cancelable promises means, but I wo
はじめに この記事は、 JavaScript/ES6 promisesについてを理解するために読んだ方がよいと思われる記事やスライド等を紹介しています。 PromisesやDeferredといった言葉を非同期処理の話などで聞いた事があるかもしれませんが、 現在Promisesは次のECMAScriptの言語仕様として策定が進められています。 ECMAScript Language Specification ECMA-262 6th Edition – DRAFT domenic/promises-unwrapping まだES6は策定段階ですが、既にPromisesについてはpolyfillとして利用できるライブラリ等もあり、また他のライブラリ内でもjQuery.Deferred()やAngularの$q等類似する実装が存在します。 そのため、Generators等に比べると今すぐ使える
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く