Skip to content

Conversation

@jsagardoy
Copy link

Changes made to ensure that Houses are loaded and displayed before Characters

Changes made to ensure that Houses are loaded and displayed before Characters
A few corrections with english expressions and typos.

* 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.

Copy link
Member

@JaimeSalas JaimeSalas Mar 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove last phrase?

Copy link
Author

@jsagardoy jsagardoy Mar 21, 2018

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks good update.

service.getCharactersByName(characterInput.value, charactersRequestConfig);
service.getHousesByName(houseInput.value, housesRequestConfig);
setTimeout(() => {
console.log('2');
Copy link
Member

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)
@jsagardoy
Copy link
Author

updated files due to comments

@jsagardoy jsagardoy closed this Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants