4 Matching Annotations
- Nov 2021
The consumer component will barely change from our last example. The only difference is the way we'll get a reference to our store (since now the store is exported from the JS module):
Now your whole WS logic can be encapsulated in your JS module. That makes for good separation of concern.
Stores are the idiomatic Svelte way when you need to import "reactivity" from your normal JS sources.
- simple explanation
- separation of concerns
- Svelte: the Svelte way
- refactoring/rewrite: example
- Svelte: extracting code from components to plain JS modules
- Svelte: reactivity
- good example