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
- Creating a writable Store
- Subscribing with $ Auto-subscription
- Updating Stores: set() and update()
- readable Stores and Custom Start Functions