logo
episode-header-image
Aug 2023
22m 28s

JS Fundamentals - Decorators

Wes Bos & Scott Tolinski - Full Stack Javascript Web Developers
About this episode

In this Hasty Treat, Scott and Wes talk about whether decorators are finally here, what the uses cases are for decorators, how to define a decorator, and what auto accessor is.

Show Notes

on classes

@loggged class C {} 

on fields

class C { @logged x = 1; } 

Auto Accessor

class C {   accessor x = 1; } 

sugar for below

class C {   #x = 1; // # means private    get x() {     return this.#x;   }    set x(val) {     this.#x = val;   } } 

Can be decorated and decorator can return new get and set and init functions

function logged(value, { kind, name }) {   if (kind === "accessor") {     let { get, set } = value;      return {       get() {         console.log(`getting ${name}`);          return get.call(this);       },        set(val) {         console.log(`setting ${name} to ${val}`);          return set.call(this, val);       },        init(initialValue) {         console.log(`initializing ${name} with value ${initialValue}`);         return initialValue;       }     };   }    // ... } 

Tweet us your tasty treats

Up next
Oct 8
944: Is Coinbase Really Writing Half Their Code With AI?
Wes and Scott talk with Kyle Cesmat about how Coinbase is writing nearly half its code with AI—while keeping quality and security front and center. They dig into tools like Cursor and Claude Code, agent-driven workflows, code review challenges, and how AI is reshaping developer p ... Show More
49m 6s
Oct 6
943: Modern React with Ricky Hanlon (React Core Dev)
Scott and Wes sit down with Ricky Hanlon from the React core team at Facebook to dive into the latest features and APIs shaping modern React development. From transitions and Suspense to fetching strategies and future directions, this episode breaks down what’s next for React and ... Show More
38m 36s
Oct 1
942: Mental Health Q&A w/ Dr. Courtney Tolinski
Wes and Scott talk with Dr. Courtney Tolinski about supporting neurodivergent teammates, navigating workplace dynamics, and recognizing strengths beyond labels. They explore ADHD diagnosis and treatment, productivity mindsets, burnout, AI in mental health, and practical routines ... Show More
57m 44s
Recommended Episodes
Feb 2019
S1E12: Really alarming breakpoints
In this episode: Xcode ships with a Swift 5 beta, Apple smacks down Facebook and Google, we discuss the value of design, and talk about important knowledge for iOS developers. - Xcode 10.2 includes an early Swift 5 version: https://developer.apple.com/documentation/xcode_release_ ... Show More
29m 26s
Nov 2020
React, Vue, jQuery: what flavor do you like your Vanilla JS?
You can find Ferdinandi's post and video here.12 years ago, back when Stack Overflow was a brand new site with just a few thousand users, someone asked a basic question: What is the difference between a framework and a library?FreeCodeCamp has its own take on this question with a ... Show More
16m 22s
Feb 2022
Is functional programming the hipster programming paradigm?
Here’s a useful primer on functional programming with JavaScript.This tutorial will guide you in exploring the fundamentals of functional programming with React.If you’re looking for more info on functional programming in React, we’d like to tell you why hooks are the best thing ... Show More
27m 49s
Nov 2023
What's new in CSS land
Una Kravets, developer advocate at Google & web platform ambassador, joins Amal & Nick to take them CSS to school as they start this podcast in CSS kindergarten and end it with a Level-Up CSS Diploma. (LUCD?) We explore all the amazing features which have recently landed in CSS — ... Show More
1h 14m
Feb 2024
Angular Signals
KBall & Amal interview Alex & Pavel from the Angular Signals team. They cover the history, how the Angular team decided to move to signals, what the new mental model looks like, migration path & even dive into community integrations and future roadmap. Leave us a comment Changelo ... Show More
1h 6m
May 2019
Chris Lattner: Compilers, LLVM, Swift, TPU, and ML Accelerators
Chris Lattner is a senior director at Google working on several projects including CPU, GPU, TPU accelerators for TensorFlow, Swift for TensorFlow, and all kinds of machine learning compiler magic going on behind the scenes. He is one of the top experts in the world on compiler t ... Show More
1h 13m
Feb 2024
Episode 108 - Diving into Amazon Q Builder with Clare Liguori
🚀 Dive into the world of AI with Morgan Willis, Principal Cloud Technologist for AWS, as she interviews Clare Liguori, a Senior Principal Software Engineer at AWS and one of the visionaries behind Amazon Q. Discover the secrets behind this groundbreaking Generative AI conversati ... Show More
48m 6s
Jan 2024
How to build a role-playing video game in 24 hours
Now you know: The human body can serve as a resonance chamber for remote car keys, effectively extending their range.A hackathon team used GenAI can create a fully playable D&D-style game in just one day.Skybox AI from Blockade Labs allows users to generate 360° skybox experience ... Show More
14m 14s
Dec 2023
Leveling up technology
Join hosts Walt Cooley and Matti McBride as they dive into Cooley’s recent presentation “Level-Up” given at the Amelicor Herd and Feed Management Conference in this episode of the Progressive Dairy Podcast. Learn how to level up technology on your operation, champion an employee ... Show More
32m 25s