Skip to content

Commit 9d9b9f1

Browse files
Version Packages (#5531)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 0502c04 commit 9d9b9f1

3 files changed

Lines changed: 24 additions & 23 deletions

File tree

.changeset/short-pugs-bow.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

packages/xstate-store/CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# @xstate/store
22

3+
## 4.1.0
4+
5+
### Minor Changes
6+
7+
- [#5530](https://github.com/statelyai/xstate/pull/5530) [`0502c04`](https://github.com/statelyai/xstate/commit/0502c041d0e7fd7826323f867e053e8f5422f59b) Thanks [@davidkpiano](https://github.com/davidkpiano)! - Expose `store.schemas` so integrations can read the store's context, event, and emitted event schemas at runtime.
8+
9+
```ts
10+
const store = createStore({
11+
schemas: {
12+
context: z.object({ count: z.number() }),
13+
events: {
14+
inc: z.object({ by: z.number() })
15+
}
16+
},
17+
context: { count: 0 },
18+
on: {
19+
inc: (context, event) => ({ count: context.count + event.by })
20+
}
21+
});
22+
23+
store.schemas?.events?.inc;
24+
```
25+
326
## 4.0.0
427

528
### Major Changes

packages/xstate-store/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@xstate/store",
3-
"version": "4.0.0",
3+
"version": "4.1.0",
44
"type": "module",
55
"description": "Simple stores",
66
"keywords": [

0 commit comments

Comments
 (0)