-
Notifications
You must be signed in to change notification settings - Fork 12
Update main.js #3
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
Conversation
Changes made to ensure that Houses are loaded and displayed before Characters
A few corrections with english expressions and typos.
01 Non blocking/README.md
Outdated
|
|
||
| * But if just one thing per time it's executed, how is this possible? | ||
| * Inside Chrome developer tools, on the network tab, we can notice that the requests are being sent concurrently. | ||
|
|
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.
Why remove last phrase?
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.
typo!
somehow... that's not what I have in my code wich is :
-
But if just one thing at a time is executed, how is this possible?
-
Inside Chrome developer tools, on the network tab, we can notice that the requests are being sent concurrently.
|
|
||
| ## In this demo we are going to study the non blocking nature of JavaScript | ||
|
|
||
| * Just one thing can happen per time in JavaScript. But the required time to get data loaded is really short. Is not just to have a really good network capabilities, there is another reason. |
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.
Thanks good update.
01 Non blocking/src/js/main.js
Outdated
| service.getCharactersByName(characterInput.value, charactersRequestConfig); | ||
| service.getHousesByName(houseInput.value, housesRequestConfig); | ||
| setTimeout(() => { | ||
| console.log('2'); |
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.
No setTimeout solution, it's not a good approach.
Changes made to use callbacks: + Changed solution to fit callback implementation + Added new function getCharacters + Remake and rename for handleHousesRequestSuccess (there was a typo in handleHousesRequestSuccess function)
updated
|
updated files due to comments |
Changes made to ensure that Houses are loaded and displayed before Characters