You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
promise-test-helper azu/promise-test-helper という名前そのままですが、 Mocha等でPromiseのテストを書くときに見落としを減らすための補助ライブラリを書きました。 MochaのPromiseテストというのは、下記のようにpromiseオブジェクトを返すとそれをPromiseのテストと認識してやってくれる機構の事を言っています。 it("should support by mocha", function () { return getSuccessPromise().then(function (value) { assert(value); }); }); 詳しくは下記を見て下さい。 MochaがPromisesのテストをサポートしました | Web scratch Promiseのテストの難しさ Promiseのテストについてはazu
Learning promises is an interesting process. Like many tools, there are common pitfalls to get stuck on. What makes promises somewhat unique is that it tends to be obvious that you're doing it wrong. Why? Promises are designed to solve a clear and well-understood problem: nested callbacks. As you start to use them however, you're code isn't that different. Obviously there's something you don't gro
If you are not redirected automatically, follow this link to example.
Lets look at JavaScript promises and try to build a simple flow that should handle multiple rejection of the same request. Why? When I first learned about promises in Javascript I was so excited that decided to use them everywhere: for data, business logic (flow), basically for everything that requires (or potentially could require) async actions. I don’t have strong Node.js experience but I guess
こんにちは、@yoheiMuneです。 JavaScriptの実装において、「Promise」を聞いたことがある方も多いのではないでしょうか。 今回は、JavaScriptにおけるPromise/A+を深く学ぶことができる記事を翻訳しました。その内容を紹介したいと思います。 Special Thanks to https://flic.kr/p/b5bNqv 翻訳について 本記事は、Matt GreerのJavaScript Promises ... In Wicked Detailの翻訳記事です。翻訳するにあたり、ご本人から許可を頂いています。 本記事では、JavaScriptにおけるPromiseの仕様がどっぷりと解説されていますので、お時間を割いて読んで頂く価値があると思います! それでは、始まりますー!! はじめに 私はJavaScriptを使った開発において、長らくPromise
Promise Anti-patternsを翻訳させて頂きました。著者のtaoofcodeから許可を頂いて翻訳、投稿しています。 Promiseは一度理解してしまえば簡単だが、いくつか頭を抱えさせるパターンがある。ここにあるのは私が経験したいくつかのアンチパターンだ。 ネストされたPromise 君は複数のPromiseをネストする: loadSomething().then(function(something) { loadAnotherthing().then(function(another) { DoSomethingOnThem(something, another); }); }); 君がこれをする理由は、両方のPromiseの結果で何かをする必要があるからだ。then()は一つ前のPromiseの結果しかコールバックに渡せないのでここでチェインを用いることはできない。 だが
JavaScript Promises ... In Wicked Detailを翻訳させて頂きました、プロミスについて実装しながらその仕組みを学べるドキュメントです。著者のMatt Greer氏から許可を得て翻訳、公開しています。 私はここしばらく仕事でJavaScriptのプロミスを利用してきました。プロミスを使い始めたときは少し頭を悩ませたりもしましたが、今やかなり効率的にプロミスを利用しています。しかし、結局のところ、私はプロミスがどのように機能しているか理解できていませんでした。この文章はこのことに対する私の解です。この文章を最後まで読めば、プロミスについてあなたもよく理解できるでしょう。 この文章では、 ほぼ Promise/A+specに準拠したプロミスを目標にインクリメンタルにプロミスを実装しながら、プロミスが非同期プログラミングのニーズにいかにマッチしているか理解していき
The official Change.org Product Development blog, writing about product, design, and engineering at the world's largest petition platform. We’ve standardized on using promises to manage most of the asynchronous interactions in our JavaScript codebase. In addition to really enjoying the extra expressiveness and aggregation possibilities offered by promises, we’re benefitting greatly from richer err
Posted 13 March 2014 and still refusing to do promise-based puns When I first started working with promises I had the overly simplistic view that passing a value into reject would mark the promise as "failed", and passing a value into resolve would mark it as "successful". However, the latter isn't always true. new Promise((resolve, reject) => { resolve(something); }).then( () => console.log('Yey'
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く