I make web development courses and have a podcast called Syntax
These slides will be available shortly after this talk
I'll tweet the link out.
A mix bag of tips and techniques that will make you a better JS developer, regardless of which framework you use
With Intersection Observer, you can be alerted when an element is fully or partially scrolled into or out of view.
per-element resize events!
Handy, even in frameworks!
Finds the closest ancestor that matches the passed selector
Great for Click Outside
Does this element match the selector?
The best 11 lines of code
Turns an iterable into an array
When all resolve()
Short circuits when one reject()s
It takes an array of baby promises and makes a Mega promise
They run concurrently (at the same time)
When one resolve() or reject()
When one resolve() or all reject()
When all finished - can be mix of resolve() or reject()
A few options
Why waste dev time on something that should never happen? #ProblemSolved
Wrap that sucker in a safety blanket
Async Functions can chain a .catch()
Just Live Your Life
Create a HOF
Hot Shot Implicit Return (WHAT)
Create a new function with your HOF
Normally we'd Handle each possible Error with next()
🤔 But that doesn't cover errors we throw, unhandled errors or syntax errors...
We need to catch all errors and pass along to the next middleware function
Then we just wrap our routes!
Any unhandled error will simply get passed along to next()
Node.js will soon exit your process on unhandled rejected promises
This is the part of the talk where
I check how much time I have left
Not totally a standard yet
Faces, Barcodes and Text