JS Lesson 4: getGithubInfo should not return the xmlhttp object
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 32/100
- Tipo di issue
- Refactoring
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- documentation
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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 :)
- Lingua principale
- JavaScript
- Stelle
- 268
- Fork
- 240
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codebar/tutorials
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 45/100
Tutte le issue di codebar/tutorials
Issue simili
-
bug customer-eng Durable Agents Inngest status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
optimization optimization:agents-md-curator
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
githubnext/gh-aw-cao#13475 ·
-
[BUG]: "Clear All" in Settings doesn't clear the saved analysis, old data comes back after reload Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
AOSSIE-Org/OrgExplorer#253 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
oxc-project/oxc#26944 ·
-
ai-observability bug team/ai-observability
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100