Syntax - Tasty Web Development Treats
Technology
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 Noteson 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 treats694: What's Up With Angular with Mark Techson
693: Lessons Learned & Bugs Fixed from Launching Syntax.fm
692: You Need Stale While Revalidate
691: Cloudflare Workers Are Next Level With Rita Kozlov And Brendan Irvine-Broque
690: How To Dark Mode and Beyond
689: You Should Be Using JavaScript Maps & Sets
688: Ex-npm Employee Making a New Package Manager?! Vlt with Darcy Clarke
687: Hosting NextJS × Spicy Sidedishes × Modern Forms × Abandoning TypeScript
686: We Need Your Help With The Secret Sauce
685: Jason Lengstorf on Live Streaming, Creating Content, and Building a Studio Space
684: Spooky Coding Horror Stories 2023 - Part 2
683: Spooky Coding Horror Stories 2023 - Part 1
Design Systems with Brad Frost
681: What's New in AI for Web Developers
680: Getting jQuery’d × Honourable Deaths of libraries We Don’t Use Anymore
679: Creator of Swift, Tesla Autopilot & Tensorflow. New AI language Mojo with Chris Lattner
678: The 2023 State of CSS Survey Part 2 × CSS Frameworks × Tooling × Browser Usage
677: Home Office Tips
676: Google IDX - VS Code in the Browser with David East
675: Potluck × Bun Thoughts × Guesting on Syntax × Why Rust?
Create your
podcast in
minutes
It is Free
Insight Story: Tech Trends Unpacked
Zero-Shot
Fast Forward by Tomorrow Unlocked: Tech past, tech future
The Unbelivable Truth - Series 1 - 26 including specials and pilot
Lex Fridman Podcast