Skip to content
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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

nildo
Copy link

@nildo nildo commented May 18, 2020

No description provided.

@CLAassistant
Copy link

CLAassistant commented May 18, 2020

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ nildo
✅ odsantos
❌ Nildo Júnior


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.

@odsantos
Copy link
Contributor

odsantos commented Dec 7, 2020

Hi @nildo could you please resolve the conflicts? Thank you.

Copy link
Contributor

@odsantos odsantos left a 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.

1-js/11-async/01-callbacks/article.md Outdated Show resolved Hide resolved
1-js/11-async/01-callbacks/article.md Show resolved Hide resolved
1-js/11-async/01-callbacks/article.md Outdated Show resolved Hide resolved
1-js/11-async/01-callbacks/article.md Outdated Show resolved Hide resolved
1-js/11-async/01-callbacks/article.md Outdated Show resolved Hide resolved
1-js/11-async/01-callbacks/article.md Outdated Show resolved Hide resolved
1-js/11-async/01-callbacks/article.md Outdated Show resolved Hide resolved
1-js/11-async/01-callbacks/article.md Outdated Show resolved Hide resolved
@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@nildo
Copy link
Author

nildo commented Aug 6, 2022

/done

Copy link
Contributor

@jonnathan-ls jonnathan-ls left a 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.
Copy link
Contributor

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 para e é eventualmente executado.

image

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.
Copy link
Contributor

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 para algo.

image

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.
Copy link
Contributor

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 para em.

image

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.
Copy link
Contributor

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 para conseguir.

image

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.
Copy link
Contributor

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 para bom.

image

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.
Copy link
Contributor

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.

image

Regra "Locuções entre vírgulas: portanto, por exemplo, na verdade"

https://community.languagetool.org/rule/show/VERB_COMMA_CONJUNCTION?lang=pt

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@odsantos
Copy link
Contributor

Hi @nildo , the English article was updated and this PR has conflicts. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants