Use Svelte 3 stores to share data between multiple unrelated components

InstructorTomasz Łakomy

Share this video with your friends

Send Tweet

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