惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
Jina AI
Jina AI
雷峰网
雷峰网
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
美团技术团队
V
V2EX
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
博客园 - Franky
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
爱范儿
爱范儿
Hugging Face - Blog
Hugging Face - Blog
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
量子位
IT之家
IT之家
人人都是产品经理
人人都是产品经理
博客园_首页
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

Syntax - Tasty Web Development Treats

Diffs, Trees, and VS Code 2.0 - Syntax #1008 8 Tech Choices to Lock In Before Agentmaxxing - Syntax #1007 Can AI Make Good Design? - Syntax #1006 Programatic and Skill based Video Creation with Remotion - Syntax #1005 TanHacked - Syntax #1004 Skills Skills Skills - Syntax #1003 The Real Pricing of LLMs - Syntax #1002 Managing Deadlines + Stress - Syntax #1001 Syntax Episode 1,000! - Syntax #1000 Writing Maintainable CSS - Syntax #999 How to Fix Vibe Coding - Syntax #998 Rating and Roasting Your Projects - Syntax #997 10 New CSS and HTML APIs - Syntax #996 Next.js Vendor Lock-in No More - Syntax #995 AI Sucks At CSS - Syntax #994 It’s Been A Hell Of Week - Syntax #993 Migrating Legacy Code Just Got Easier - Syntax #992 Vite’s bet on Cloudflare (VOID Framework) - Syntax #991 Vite Is Taking Over (Vite+) - Syntax #990 State of JS 2025 - Syntax #989 Cloudflare’s Next.js Slop Fork - Syntax #988 Remote Coding Agents - Syntax #987 Does Code Quality Matter Anymore? - Syntax #986 Stop putting secrets in .env - Syntax #985 How to Make a DOM Library Render Anything w/ Paolo Ricciuti - Syntax #984 Why I Chose Electron Over Native (And I’d Do It Again) - Syntax #983 Bots Are Ruining the Internet - Syntax #982 Browsers Are Finally Catching Up (Interop 2026) - Syntax #981 AI Coding Explained - Syntax #980 WebMCP: New Standard to Expose Your Apps to AI - Syntax #979
Manage State in JavaScript Like a Pro! - Syntax #850
2024-11-20 · via Syntax - Tasty Web Development Treats
850

November 20th, 2024 × #javascript#state-management#front-end

This episode covers different approaches to state management in JavaScript, including reducer-based, mutation-based and atom-based state. Buzzwords like reactive state, stores, immutability vs mutability, state updaters and more are also explained.

Wes Bos

Wes Bos Host

Scott Tolinski

Scott Tolinski Host

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 approaches and libraries, mutation-based state, and tools like Zustand and xState, to help you manage state like a pro.

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.
  • 57:02 Sick Picks + Shameless Plugs.

Sick Picks

Shameless Plugs

Syntax: X Instagram Tiktok LinkedIn Threads

Wes: X Instagram Tiktok LinkedIn Threads

Scott: X Instagram Tiktok LinkedIn Threads

Randy: X Instagram YouTube Threads