Code-the-Dream-School / school-pages

static content for CTD students
https://school-pages.codethedream.org/
4 stars 6 forks source link

Add `asyncWrapper` writeup for week 6 #26

Open jdevries3133 opened 1 year ago

jdevries3133 commented 1 year ago

I notice that students' answers to this question in week 6 is generally not great:

In this lesson, you created a middleware function called asyncWrapper. Why?

I have my own perspective on answering this question, but the ideal writeup will be aligned with what the YouTube tutorial says. Maybe the YouTube tutorial just glazes over explicitly answering this question... I am not sure; I haven't reviewed it yet.

In any case, I think the best answer here is something about it being an example of the adapter pattern. We have to adapt from the callback-async-paradigm of Express to the async/await paradigm that we'd prefer to write our programs in.