
Hasty Treat - Things You Should Know About Javascript Events
05/04/20 • 13 min
2 Listeners
In this Hasty Treat, Scott and Wes talk about javascript events, and how to avoid some common pitfalls!
Prismic - SponsorPrismic is a Headless CMS that makes it easy to build website pages as a set of components. Break pages into sections of components using React, Vue, or whatever you like. Make corresponding Slices in Prismic. Start building pages dynamically in minutes. Get started at prismic.io/syntax.
Show Notes02:23 - Event bubbling
- Some events bubble, some don’t
- Clicks bubble
- Mouseevents bubble
- Focus doesn’t bubble
04:10 - Event capturing
- Capture: down, bubble up
- Canceling: prevent default
- target` vs currentTarget
- currentTarget is what got clicked
- target is what you listened for the click on
- event.isTrusted
- addEventListener once: true
- Scott’s Instagram
- LevelUpTutorials Instagram
- Wes’ Instagram
- Wes’ Twitter
- Wes’ Facebook
- Scott’s Twitter
- Make sure to include @SyntaxFM in your tweets
In this Hasty Treat, Scott and Wes talk about javascript events, and how to avoid some common pitfalls!
Prismic - SponsorPrismic is a Headless CMS that makes it easy to build website pages as a set of components. Break pages into sections of components using React, Vue, or whatever you like. Make corresponding Slices in Prismic. Start building pages dynamically in minutes. Get started at prismic.io/syntax.
Show Notes02:23 - Event bubbling
- Some events bubble, some don’t
- Clicks bubble
- Mouseevents bubble
- Focus doesn’t bubble
04:10 - Event capturing
- Capture: down, bubble up
- Canceling: prevent default
- target` vs currentTarget
- currentTarget is what got clicked
- target is what you listened for the click on
- event.isTrusted
- addEventListener once: true
- Scott’s Instagram
- LevelUpTutorials Instagram
- Wes’ Instagram
- Wes’ Twitter
- Wes’ Facebook
- Scott’s Twitter
- Make sure to include @SyntaxFM in your tweets
Previous Episode

Potluck Part 2 - Magic GQLess × Are classes dead? × Custom Hooks × Staying Up To Date × CSS × More!
It’s another potluck! In this episode, Scott and Wes answer your questions about custom hooks, static site generators, code management, CSS, and more!
Sentry - SponsorIf you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”.
Freshbooks - SponsorGet a 30 day free trial of Freshbooks at freshbooks.com/syntax and put SYNTAX in the “How did you hear about us?” section.
Show Notes04:02 - Q: Could you do a quick overview of how to effectively use a platform like Cloudinary? I have a Gatsby site with a lot of images and want to use something like Cloudinary to help with optimization, but the docs aren’t completely clear to me how to get the most out of their service.
10:58 - Q: What kind of CSS pre/post-processor you usually use? What are the pros and cons of pre-processor (SASS, SCSS, LESS) and post-processor (PostCSS)?
16:22 - Q: What is the most effective way to share a project with the internet and get feedback? I’m in a phase right now where I’m building loads of new web things with React and JavaScript, but the only place I can think to share them is my Twitter, where only like 3 people will see them.
18:35 - Q: What are your thoughts on classes in JavaScript? Do we still need them in 2020, or has the functional programming paradigm made them largely unnecessary? Does the answer change based on the size of the project and/or team?
23:56 - Q: Does ES2020 have var? Also, is ES2020 a real spec or just a term people are using?
27:37 - Q: Have you tried gqless, a graphql client alternative to something like Apollo client? Very interesting idea for clean and maintainable code.
29:15 - Q: What are the main differences in working for a software agency and a software product company? Pros and cons of each?
33:53 - Q: Advice for having static blog with minimal moving parts? I used to have a static blog but I eventually got sick of touching it because instead of writing content I often got stuck keeping up with all the dependencies involved.
38:18 - Q: Micro Frontends—is it the solution to rewriting legacy components?
42:16 - Q: I am relatively new to web development and I feel like it is very difficult to “catch up” with JavaScript. It seems like whenever I try to contribute an open source, I can’t figure out the code because they’re using newer (and presumably better) ways of doing things. How can I get up to date with everything that’s going on in the JavaScript world? Also, at what point should I start learning a front-end framework?
46:56 - Q: My team and I are starting to write pretty complicated custom hooks gathering data from a number of different endpoints and/or polling certain endpoints on a continuous interval timer before returning it to the component that needs the data. Since this is the case some hooks have gotten fairly large with multiple functions inside of them getting called to get/manipulate all the data, or multiple hooks using those same functions to get slightly different data. Is it a best practice to keep all those hooks together in one file if they support all the hooks? Or should we break the hooks into separate files and move the helper functions into another file and just have one hook per file?
51:10 - Q: Any tips for navigating projects with bad project managers? Working with non-technical agency project managers makes it pretty difficult to effectively plan and allocate time to ensure that all of the projects are done on time, on budget, and done well. It’s important to me to maintain an optimistic attitude in the organization, but sometimes I’d love to just hit 'em with the 'ol “Peace out” and go smoke some pork butt. Wondering if you guys have any good experience managing these types of projects?
55:45 - Q: I’m committing often and early, but this means that I end up writing the same vague git commit message over and over again. I know the solution to the problem is to just be more verbose, but it’s a difficult habit to break. Any advice?
LinksNext Episode

Bootcamps, Getting a Job, and Income Share Agreements with Heather Payne
In this episode of Syntax, Scott and Wes talk with Heather Payne about bootcamps — how to get the most out of them and what to look out for!
Sanity - SponsorSanity.io is a real-time headless CMS with a fully customizable Content Studio built in React. Get a Sanity powered site up and running in minutes at sanity.io/create. Get an awesome supercharged free developer plan on sanity.io/syntax.
Sentry - SponsorIf you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”.
Guests Show Notes07:52 - Bootcamps
- What do you teach in the bootcamp?
- How long is it?
- SHow do you validate and pick topics?
- What makes a good bootcamp student?
- Do bootcamps work?
- How do you get the most out of a bootcamp?
20:45 - Finding a job
- How do you prepare for an interview?
- What qualities, outside of technical skill, do you see in developers who get jobs easily out of the bootcamp?
- Do you see any common traits in the few that don’t get jobs?
- What about getting a job in the current climate?
43:30 - Other
- How do income share agreements work?
- Pay what you can income share agreements
- How do you tell if a bootcamp is good?
- Heather: Whereby
- Scott: Original Grind Coffee Co. Cold Brew Coffee Maker (1 Gallon)
- Wes: iStat Menus
- Heather: Juno’s Continuing Education Online Courses
- Scott: Design Systems In Figma - Sign up for the year and save 25%!
- Wes: Wes’ New Website - Use the coupon code ‘Syntax’ for $10 off!
- Scott’s Instagram
- LevelUpTutorials Instagram
- Wes’ Instagram
- Wes’ Twitter
- Wes’ Facebook
- Scott’s Twitter
- Make sure to include @SyntaxFM in your tweets
If you like this episode you’ll love

ITSPmagazine Podcasts

CodeWinds - Leading edge web developer news and training | javascript / React.js / Node.js / HTML5 / web development - Jeff Barczewski

Joomla Beat Podcast | Web design, development, online marketing, social media & website management

Beetle Moment Marketing Podcast

The Art of Product
Episode Comments
Generate a badge
Get a badge for your website that links back to this episode
<a href="https://goodpods.com/podcasts/syntax-tasty-web-development-treats-37432/hasty-treat-things-you-should-know-about-javascript-events-1552513"> <img src="https://storage.googleapis.com/goodpods-images-bucket/badges/generic-badge-1.svg" alt="listen to hasty treat - things you should know about javascript events on goodpods" style="width: 225px" /> </a>
Copy