Skip to content

Commit

Permalink
add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
DavKato committed Sep 4, 2021
1 parent 95a5520 commit 0f77ec3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .changeset/blue-poems-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@xstate/svelte': minor
---

Added new useSelector(actor, selector), which subscribes to actor and returns a svelte store that represents the selected state derived from selector(snapshot):

```svelte
<script>
// It won't be updated unless the selected value changed.
const value = useSelector(service, (state) => state.context.value);
</script>
<p>{$value}</p>
```

0 comments on commit 0f77ec3

Please sign in to comment.