Course lesson

Use Svelte 3 stores to share data between multiple unrelated components

Not all application state belongs inside your application's component hierarchy. Sometimes, you'll have values that need to be accessed by multiple unrelated components, or by a regular JavaScript module.

Duration
2 min
Access
Pro
Transcript
Available

Not all application state belongs inside your application's component hierarchy. Sometimes, you'll have values that need to be accessed by multiple unrelated components, or by a regular JavaScript module.

In Svelte, we do this with stores. In this lesson we're going to learn how to create a writable store and how to use it to allow Incrementer and Decrementer components modify the value of the store