DEV Community

Discussion on: Managing state in Svelte

Collapse
 
joshnuss profile image
Joshua Nussbaum

For remote state, you can always use fetch or websocket.

A useful approach is to create a store that is backed with a remote API. So whenever the store changes, you push the changes to the remote API and vice versa.

Here's an example of an HTTP REST store that manages a singleton:
gist.github.com/joshnuss/e4c4a4965...