Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Dec 24, 2024
1 parent 8276156 commit 64523d8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .changeset/tasty-ravens-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@xstate/store': minor
---

The store now extends EventTarget, allowing for native DOM event handling capabilities while maintaining the existing `.on()` API. This change:

- Adds support for standard `.addEventListener(…)` and `.removeEventListener(…)` methods
- Simplifies internal event handling by leveraging native `EventTarget` functionality
- Maintains full backwards compatibility with existing `.on(…)` method

```ts
// ...
store.addEventListener('incremented', (event) => {
console.log(event.detail);
});
```

0 comments on commit 64523d8

Please sign in to comment.