0Pricing
Sveltejs Academy · Lesson

Store Architecture: Feature Modules

Organize stores into feature modules with encapsulated actions and selectors.

Why Feature Modules

Large apps benefit from organizing stores by feature: cart/, auth/, orders/.

Each Module Exports

Each module exports state, derived values, and actions for that feature.

// $lib/cart/store.js
export const items = writable([]);
export function add(item) { items.update(i => [...i, item]); }

All lessons in this course

  1. Store Architecture: Feature Modules
  2. Event Bus Pattern with Stores
  3. Optimistic UI Updates
  4. Undo/Redo with Store History
← Back to Sveltejs Academy