0Pricing
Sveltejs Academy · Lesson

Updating Stores: set() and update()

Replace or transform store values using set() and the updater callback in update().

Two Update Modes

Stores expose two update methods: set(value) to replace and update(fn) to transform.

set Example

Replace the whole value.

count.set(5);

All lessons in this course

  1. Creating a writable Store
  2. Subscribing with $ Auto-subscription
  3. Updating Stores: set() and update()
  4. readable Stores and Custom Start Functions
← Back to Sveltejs Academy