Manage State in JavaScript Like a Pro!

Syntax • November 20, 2024
Video Thumbnail

About

No channel description available.

Video Description

Scott and Wes serve up state management in JavaScript, breaking down key concepts like reactive state, state updaters, and global vs local state. They also explore various tools like Zustand and xState. 👉 Join the exclusive newsletter - https://syntax.fm/snackpack Show Notes 00:00 Welcome to Syntax! 01:22 Brought to you by Sentry.io. 03:10 What is state? 03:29 Common state jargon. 03:48 Reactive State. 04:14 Store. 04:46 Immutable vs Mutable State. 05:53 State updaters. 06:15 Signals. 06:49 Observables. 07:07 UI is a function of state. 08:39 State Machine. 10:58 Binding state. 11:36 Global vs local. 11:49 Computed State, derived state, selector state. 12:41 Approaches to state management. 12:52 Reducer based. 16:39 Mutation based state. 21:17 Atom based state. 25:15 Ways to hold state. 25:17 Holding state in an object. 27:38 Holding state in the URL. 29:34 Holding state in IndexedDB, local storage, and cookies. 32:16 Holding state with FormData. 33:56 Holding state with Signals. 37:27 Holding state with the server database. 38:55 Global State vs Component State. 40:39 Sharing state. 42:58 State libraries. 45:26 Zustand. 50:24 Jotai. 51:50 xState. 54:56 Easy Peasy. 55:24 Pinia. 56:01 TanStack Query. 57:02 Sick Picks + Shameless Plugs. All links available at https://syntax.fm/850 ------------------------------------------------------------------------------ Hit us up on Socials! Scott: https://twitter.com/stolinski Wes: https://twitter.com/wesbos Randy: https://www.youtube.com/@randyrektor Syntax: https://twitter.com/syntaxfm http://www.syntax.fm Brought to you by Sentry.io #webdevelopment #webdeveloper #javascript

Upgrade Your Gear Today

AI-recommended products based on this video

Loading...
SmallRig FX3 / FX30 HawkLock Quick Release Camera Cage Kit for Sony with Cable Clamp, Bulit-in QR Cold Shoe NATO Rail/QR Plate for Arca, Modular Design Compatible with Original XLR Handle - 4770

SmallRig FX3 / FX30 HawkLock Quick Release Camera Cage Kit for Sony with Cable Clamp, Bulit-in QR Cold Shoe NATO Rail/QR Plate for Arca, Modular Design Compatible with Original XLR Handle - 4770

(35)
$124.94
FREE delivery Thu, Jun 19
Loading...
SmallRig ZV-E1 Camera Baseplate for Sony ZV-E1, Built-in Cold Shoe Mount and QR Plate (for Arca) Quick Switch Between Tripod and Stabilizer for DJI RS 2 / RSC 2 / RS 3 / RS 3 Pro - 4314

SmallRig ZV-E1 Camera Baseplate for Sony ZV-E1, Built-in Cold Shoe Mount and QR Plate (for Arca) Quick Switch Between Tripod and Stabilizer for DJI RS 2 / RSC 2 / RS 3 / RS 3 Pro - 4314

(3)
$44.99
FREE delivery Thu, Jun 19
Loading...
SmallRig ZV-E10 II Base Plate for Sony Alpha ZV-E10 II, Bottom Mount Plate with Quick-Release Plate for Arca, QD Socket, Hand Strap Hole, 1/4"-20 Threaded Hole - 4950

SmallRig ZV-E10 II Base Plate for Sony Alpha ZV-E10 II, Bottom Mount Plate with Quick-Release Plate for Arca, QD Socket, Hand Strap Hole, 1/4"-20 Threaded Hole - 4950

(13)
$37.99
FREE delivery Sat, Jun 21
Loading...
SmallRig Baseplate for Sony Alpha 6700, Bottom Mount Plate Built-in Quick Release Plate for Arca, Supporting Quick Switch Between Tripod and Stabilizer (for DJI RS 2 / RSC 2 / RS 3 / RS 3 Pro) - 4338

SmallRig Baseplate for Sony Alpha 6700, Bottom Mount Plate Built-in Quick Release Plate for Arca, Supporting Quick Switch Between Tripod and Stabilizer (for DJI RS 2 / RSC 2 / RS 3 / RS 3 Pro) - 4338

(85)
$38.24
FREE delivery Thu, Jun 19
Loading...
Habits of the Household: Practicing the Story of God in Everyday Family Rhythms

Habits of the Household: Practicing the Story of God in Everyday Family Rhythms

(2,331)
$19.99
FREE delivery Sun, Aug 10 on your first order
Loading...
26x15 Inch Food Warming Mat - Electric Design with Heat-Resistant Pad, 6 Temp Modes, 6 Timer Options & Child Lock, Perfect for Family Gatherings & Everyday Meals

26x15 Inch Food Warming Mat - Electric Design with Heat-Resistant Pad, 6 Temp Modes, 6 Timer Options & Child Lock, Perfect for Family Gatherings & Everyday Meals

(86)
$49.99
Prime
Loading...
Habits of the Household: Practicing the Story of God in Everyday Family Rhythms

Habits of the Household: Practicing the Story of God in Everyday Family Rhythms

(2,331)
$19.99
FREE delivery Sun, Aug 10 on your first order
Loading...
26x15 Inch Food Warming Mat - Electric Design with Heat-Resistant Pad, 6 Temp Modes, 6 Timer Options & Child Lock, Perfect for Family Gatherings & Everyday Meals

26x15 Inch Food Warming Mat - Electric Design with Heat-Resistant Pad, 6 Temp Modes, 6 Timer Options & Child Lock, Perfect for Family Gatherings & Everyday Meals

(86)
$49.99
Prime
Loading...
Far Field Probiotic Yogurt Coated Fruit Bites – 30 bag Multipack, Real Fruit, Real Yogurt, No Artificial Flavors, Individually Portioned Snacks, 600 gram Bag

Far Field Probiotic Yogurt Coated Fruit Bites – 30 bag Multipack, Real Fruit, Real Yogurt, No Artificial Flavors, Individually Portioned Snacks, 600 gram Bag

(9)
$19.99
FREE delivery Tue, Nov 11 on your first order
Loading...
SunKol 10.1" IP67 Rugged Tablet (N5100 8GB+256GB) Windows 11 Pro Waterproof Industrial Tablet PC, Fingerprint, 12000mAh Battery, 500nit, GPS, WiFi, 4G, BT4.2, for Outdoor Field Work

SunKol 10.1" IP67 Rugged Tablet (N5100 8GB+256GB) Windows 11 Pro Waterproof Industrial Tablet PC, Fingerprint, 12000mAh Battery, 500nit, GPS, WiFi, 4G, BT4.2, for Outdoor Field Work

(5)
$788.99
FREE delivery Sep 23 - Oct 16
Loading...
Granny Pants Yard Game, 5/10/20 Balls and 1/2 Pump for Kids, Adults, Backyard Parties and Field Day,Granny Pants Outdoor Game (Pink+Green)

Granny Pants Yard Game, 5/10/20 Balls and 1/2 Pump for Kids, Adults, Backyard Parties and Field Day,Granny Pants Outdoor Game (Pink+Green)

(0)
$49.99
FREE delivery Jul 9 - 11
Loading...
Habits of the Household: Practicing the Story of God in Everyday Family Rhythms

Habits of the Household: Practicing the Story of God in Everyday Family Rhythms

(2,331)
$19.99
FREE delivery Sun, Aug 10 on your first order
Loading...
26x15 Inch Food Warming Mat - Electric Design with Heat-Resistant Pad, 6 Temp Modes, 6 Timer Options & Child Lock, Perfect for Family Gatherings & Everyday Meals

26x15 Inch Food Warming Mat - Electric Design with Heat-Resistant Pad, 6 Temp Modes, 6 Timer Options & Child Lock, Perfect for Family Gatherings & Everyday Meals

(86)
$49.99
Prime
Loading...
LifeStraw Go Series – BPA-Free Water Filter Bottle for Travel and Everyday use removes Bacteria, parasites and microplastics, Improves Taste

LifeStraw Go Series – BPA-Free Water Filter Bottle for Travel and Everyday use removes Bacteria, parasites and microplastics, Improves Taste

(2,775)
$61.85$41.83
FREE delivery Tue, Sep 23
Loading...
ESR for iPhone 16 Pro Max Case, Camera Control Capture Button, Compatible with MagSafe, Shockproof Military-Grade Protection, Phone Case for iPhone 16 Pro Max, Classic Hybrid Case(HaloLock), Clear

ESR for iPhone 16 Pro Max Case, Camera Control Capture Button, Compatible with MagSafe, Shockproof Military-Grade Protection, Phone Case for iPhone 16 Pro Max, Classic Hybrid Case(HaloLock), Clear

(87,497)
$11.99$10.96
FREE delivery Sat, Sep 20 on your first order
500+ bought in past month
Loading...
Habits of the Household: Practicing the Story of God in Everyday Family Rhythms

Habits of the Household: Practicing the Story of God in Everyday Family Rhythms

(2,331)
$19.99
FREE delivery Sun, Aug 10 on your first order
Loading...
26x15 Inch Food Warming Mat - Electric Design with Heat-Resistant Pad, 6 Temp Modes, 6 Timer Options & Child Lock, Perfect for Family Gatherings & Everyday Meals

26x15 Inch Food Warming Mat - Electric Design with Heat-Resistant Pad, 6 Temp Modes, 6 Timer Options & Child Lock, Perfect for Family Gatherings & Everyday Meals

(86)
$49.99
Prime
Loading...
HOMESPON Large Corduroy Tote Bag for Women Everyday Shoulder Bag with Pockets and Zipper for Work Travel Vacation

HOMESPON Large Corduroy Tote Bag for Women Everyday Shoulder Bag with Pockets and Zipper for Work Travel Vacation

(263)
$22.39
FREE delivery Sat, Jun 14 on your first order