
JSJ 455: Introducing and Understanding Svelte and Sapper with Mark Volkmann
JavaScript Jabber
00:00
How to Manage State Within a Component
State management is a really contentious topic, because you have some frameworks like angular that are very opinionated about how it manages state. In sfelt, the way that it works is that you just declare a variable. And then going up from there, if i need to share state between components, then i use what are called stores. There are a few different kinds of stores in spelt. You know that if you're subscribed to that store, your component will receive up dates and can re render. We can get into all the details of exactly what it means to subscribe to a store and some variations on stores, but that's the basic of how state management works in spilt.
Transcript
Play full episode