Lab 12 - Them Problem
Categories:
2 minute read
Learning Objectives
By the end of this lab, you should be able to:
- call functions that return promises
- test functions that return promises
- recognize that not every problem is yours, but that some problems are “theirs”, “them problem"s if you will.
Goal
Provided with the starting code from the template here or from your instructor (check with them), create something similar to this demo available for mobile and desktop.
There are several “Them Problems” described by a pair of discordant emotional states in which “you” have a positive affect, but “they"have a negative affect, e.g.
- you
- poppin'
- they
- stoppin'
- you
- packin'
- they
- lackin'
Currently
In the provided starter code, the list of possible states “you” might be in comes from a call to a synchronous function (getYous
) that immediately returns a short array of strings. Once one of these is selected, the starting code retrieves the corresponding state that “they” might be in when it’s a “them problem” through a call to a synchronous function (getThey
). This function also immediately returns, but only 1 string.
Your task
- replace the call to
getYous
with a call togetOptions
which returns a promise that resolves to the array of strings. - replace the call to
getThey
with a call togetThemProblem
which returns a promise that resolves to the string.
Stretch Goals
JS
- invoke
toggleLoader
when appropriate to show the loading animation to give the visitor feedback that something is happening “in the background”.- note: this js function is already in the code and the necessary CSS is already in the provided CSS file.
- inspect and critique the JS code.
- did you see anything new (to you)?
- is it DRY?
- is it organized?
- is it performant?
- what would you change?
Content
Add to the collection of “them problems”
- how many can you come up with?
- do they rhyme?
- what’s your fav?
- did you add them successfully to your demo?
HTML
Inspect and critique the HTML structure
- did you see anything new (to you)?
- is the provided HTML semantic?
- is it accessible?
- is it responsive?
- is it performant?
- what would you change?
CSS
- Inspect and critique the aesthetic and user experience. try the site in:
- dark vs. light mode
- narrow vs. wide viewports
- on faster and slower(throttled) network connections
- Inspect and critique the CSS code.
- did you see anything new (to you)?
- is it DRY?
- is it organized?
- is it performant?
- what would you change?