max-mapper / max-mapper/callback-hell
Callback binding
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 858
- フォーク
- 101
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Maybe it would be useful to mention callback binding, I know that personally was confusing for me in the beginning. For instance, you might expect this to work:
Something.prototype.foo = function (cb) {
someOtherObj.bar(function (err, res) {
cb(null, this.value)
})
}
But actually it will not work since the innermost callback is called from the context of someOtherObj, and this doesn't resolve to the Something instance (so this.value end up being something else).
The solutions are foo(function () { this.value... }.bind(this)), var self = this; foo(function () { self.value... }), or maybe ES6 arrow functions (since they take their context from wherever they were created), () => { this.value... }.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ファイル、テスト、またはドキュメントのエントリーポイントは指定されていません。まず、JavaScript のコールバックと this のバインディングを扱っているセクションを見つけてください。混乱を招くコンテキストと、提案されているバインディングの代替方法を明確に示す例を追加し、その後、ドキュメントが正しくレンダリングされることを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100