-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduction callbacks #133
base: master
Are you sure you want to change the base?
Conversation
Nildo Júnior seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Hi @nildo could you please resolve the conflicts? Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @nildo please, have you tested the code (as much as possible) as the author suggests?
Not an imperative, but having time that might be helpful.
I hope that you might let me know if you don't agree with any change.
Thank you,
Osvaldo.
Please make the requested changes. After it, add a comment "/done". |
/done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Olá @nildo, segue minha revisão!
*/!* | ||
``` | ||
|
||
Naturally, the browser probably didn't have time to load the script. So the immediate call to the new function fails. As of now, the `loadScript` function doesn't provide a way to track the load completion. The script loads and eventually runs, that's all. But we'd like to know when it happens, to use new functions and variables from that script. | ||
Naturalmente, o navegador provavelmente não teve tempo de carregar o script. Então a chamada imediata para a nova função falha. Do jeito que está, a função `loadScript` não provê uma maneira de saber quando o carregamento termina. O script carrega e eventualmente é executado, isso é tudo. Mas nós queremos saber quando isso acontece, para podermos usar as novas funções e variáveis daquele script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sugestão de alteração:
- Alterar
e eventualmente é executado
parae é eventualmente executado
.
Regra "Colocação de advérbio"
https://community.languagetool.org/rule/show/COLOCA%C3%87%C3%83O_ADV%C3%89RBIO?lang=pt
}); | ||
*/!* | ||
``` | ||
|
||
That's called a "callback-based" style of asynchronous programming. A function that does something asynchronously should provide a `callback` argument where we put the function to run after it's complete. | ||
Isso é chamado de programação assíncrona "baseada em callbacks". A função que faz alguma coisa assincronamente deve prover um argumento `callback` onde nós colocamos a função que vai executar depois que ela estiver completa. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sugestão de alteração:
- Alterar
alguma coisa
paraalgo
.
Regra "2. Expressões prolixas"
https://community.languagetool.org/rule/show/PT_WORDINESS_REPLACE?lang=pt
@@ -150,13 +150,13 @@ loadScript('/my/script.js', function(script) { | |||
}); | |||
``` | |||
|
|||
So, every new action is inside a callback. That's fine for few actions, but not good for many, so we'll see other variants soon. | |||
Então, toda ação nova fica dentro de um callback. Tudo bem para poucas ações, mas não é bom para muitas ações. Por isso nós vamos ver outras variantes em breve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sugestão de alteração:
- Alterar
dentro de
paraem
.
Regra "Dentro de/da(s)/do(s) > em/na(s)/no(s)"
https://community.languagetool.org/rule/show/DENTRO_DE_DA_DAS_DO_DOS_EM_NA_NAS_NO_NOS?lang=pt
|
||
In the above examples we didn't consider errors. What if the script loading fails? Our callback should be able to react on that. | ||
No exemplo acima nós não consideramos erros. E se o carregamento do script falhar? Nosso callback deveria ser capaz de reagir a isso. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sugestão de alteração:
- Alterar
ser capaz de
paraconseguir
.
Regra "Ser capaz de → Conseguir"
https://community.languagetool.org/rule/show/SER_CAPAZ_DE_CONSEGUIR?lang=pt
|
||
So this way of coding isn't very good. | ||
Então esse jeito de programar não é muito bom. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sugestão de alteração:
- Alterar
muito bom
parabom
.
Regra "2. Expressões prolixas"
https://community.languagetool.org/rule/show/PT_WORDINESS_REPLACE?lang=pt
|
||
It works, but the code looks like a torn apart spreadsheet. It's difficult to read, and you probably noticed that one needs to eye-jump between pieces while reading it. That's inconvenient, especially if the reader is not familiar with the code and doesn't know where to eye-jump. | ||
Funciona, porém o código parece uma planilha dividida. É difícil de ler, e você provavelmente percebeu que precisamos de pular entre as partes do código enquanto estamos lendo ele. Isso é inconveniente, especialmente se o leitor não estiver familiarizado com o código e não souber para onde pular. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sugestão de alteração:
- Adicionar virgula após a locução
porém
.
Regra "Locuções entre vírgulas: portanto, por exemplo, na verdade"
https://community.languagetool.org/rule/show/VERB_COMMA_CONJUNCTION?lang=pt
Please make the requested changes. After it, add a comment "/done". |
Hi @nildo , the English article was updated and this PR has conflicts. Thanks. |
No description provided.