JS Lesson 4: getGithubInfo should not return the xmlhttp object
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 32/100
- issue の種類
- リファクタリング
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript
調査の方向性
Start with js/lesson4/tutorial.md and inspect the getGithubInfo example and its surrounding lesson context. Resolve the intended success and failure return contract with maintainers, then update the tutorial so the example no longer exposes the XMLHttpRequest object and clearly shows the resulting behavior.
索引モデルが issue の本文から書いたものです。
説明
Where
The tutorial https://github.com/codebar/tutorials/blob/gh-pages/js/lesson4/tutorial.md
What
The code block
function getGithubInfo(username) {
var url = 'https://api.github.com/users/' + username;
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('GET', url, false);
xmlhttp.send();
return xmlhttp;
}
returns the xmlhttp object. I would argue that this is bad practice and the function should return only the data or a signifier of failure, for example throwing an error. The reason I think this is bad practice is that it as a function should only give data, and should not let its functionality "leak out" (sorry I am struggling to describe this well).
Am I willing to fix
Yes, I just wanted to know if people agreed with me first :)
- 主要言語
- JavaScript
- スター
- 268
- フォーク
- 240
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codebar/tutorials のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 45/100
codebar/tutorials の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bevyengine/bevy-website#2595 ·