Tackle Complex Async Behavior One Step at a Time With Svelte Stores
summary
Custom Svelte stores (published as the open source Square Svelte Store package) implement async readable, loadable derived and async writable primitives that add a .load/.reload API, bubble load requests through derived chains, and support lazy loading and optimistic writes. Example usage combines a synchronous and remote letters array, and a social-sidebar demo handles a personalization flow with a 5% test cohort, preview endpoints, and optimistic persistence; the pattern isolates each async step, removes bookkeeping, and is proven workable via supplied CodeSandbox examples.
AI-written summary · about
chapters (22)
- 0:00Introduction
- 1:15About me
- 2:18Sketch Microservices
- 3:12Whats Our Plan
- 3:40Agenda
- 4:23What is a Svelte Store
- 5:07Unintuitive Concept
- 5:44Design Properties
- 7:31Complex Relationships
- 8:25The Problem
- 8:55Solutions
- 10:42Custom Stores
- 14:52The Problem With Derived Stores
- 16:14Custom Store
- 17:37Load Value
- 19:02Load Derived Stores
- 20:30Svelte Store
- 21:40Async Derived Store
- 22:48Async Writable Store
- 25:05Example
- 26:59Code Sandbox
- 27:18Conclusion
related talks
05mTransforming data to and from storage areas using Svelte custom stores
02h 57mSvelte Cookbook: A Masterclass on SvelteJS
36mSvelte - Web App Development Reimagined
24mSvelte: the last framework we need?
32mFrom React to Svelte
26mLocal First Svelte
29mResponsive Svelte (exploring Svelte's reactivity)
25mSimplify Web App Development with Svelte
