You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jialvaradob opened this issue
Sep 13, 2023
· 2 comments
Assignees
Labels
check-inYou can use the check-in template to track your module learning objectives, your weekly progresschecked-1After review, we add the checked labelchecked-2week_1week-2week-3
You understand the JavaScript Event Loop, and can demonstrate this by using setTimeout and setInterval to schedule simple tasks.
You can explain why Asynchronous Programming is important for programs that have blocking and non-blocking tasks.
You can explain the basics of the Client/Server model and HTTP requests and can fetch data from RESTful APIs.
You can break down an asynchronous problem into smaller tasks and solve it using promises. This includes identify which tasks depend on each other and which are independent:
dependent tasks: The return value from one task is required to start the next task, these must be completed in a specific order - .then
independent tasks: These tasks do not use each other's return values, they can be completed at the same time - Promise.allsystem.
You can fetch data from an API and render it into the DOM using /api-calls, /handlers and async/await syntax.
You can write unit tests for functions that return promises using async/await syntax.
constgetUsers=()=>{returnfetch(`https://jsonplaceholder.typicode.com/users`).then((res)=>{if(!res.ok){thrownewError(`Failed to fetch users with status: ${res.status}`,);}returnres.json();// convert the response to a JavaScript object}).catch((Error)=>{console.error(err);returnnull;});};constneedData=(data)=>{};constHandlerUser=()=>{getUsers().then((data)=>{console.log(data);// you will get here what ever the first then return so in this case data// here you can do whatever you want with your data , you can loop throw them because they are an array in this case// you can pass them to another function if you want toneedData(data);});};HandlerUser();
check-inYou can use the check-in template to track your module learning objectives, your weekly progresschecked-1After review, we add the checked labelchecked-2week_1week-2week-3
My stopwatch preview
Learning Objectives
setTimeout
andsetInterval
to schedule simple tasks.fetch
data from RESTful APIs..then
Promise.all
system./api-calls
,/handlers
andasync
/await
syntax.async
/await
syntax.Week 1
I Need Help With:
What went well?
What went less well?
Lessons Learned
Sunday Prep Work
Week 2
I Need Help With:
What went well?
What went less well?
Lessons Learned
Sunday Prep Work
Finishing the project.
Doing as many exercises as possible.
Week 3
I Need Help With:
What went well?
What went less well?
Lessons Learned
Sunday Prep Work
Courage
---- END CHECK-IN TEMPLATE ---->
The text was updated successfully, but these errors were encountered: