Skip to content

Commit

Permalink
Add missing actions to main export (#4098)
Browse files Browse the repository at this point in the history
* Add other actions to main export

* Add changeset
  • Loading branch information
davidkpiano committed Jun 25, 2023
1 parent 49966df commit ae76918
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .changeset/kind-donkeys-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'xstate': minor
---

The `log`, `pure`, `choose`, and `stop` actions were added to the main export:

```ts
import { log, pure, choose, stop } from 'xstate';
```
10 changes: 9 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export {
sendParent,
sendUpdate,
raise,
log,
pure,
choose,
stop,
forwardTo,
interpret,
Interpreter,
Expand All @@ -51,7 +55,11 @@ const {
sendUpdate,
forwardTo,
doneInvoke,
raise
raise,
log,
pure,
choose,
stop
} = actions;

declare global {
Expand Down
6 changes: 2 additions & 4 deletions packages/core/test/actions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import {
ActorRefFrom,
AnyStateMachine,
StateNode,
actions
} from '../src/index';
import {
actions,
pure,
sendParent,
log,
Expand All @@ -19,7 +17,7 @@ import {
stop,
send,
raise
} from '../src/actions';
} from '../src/index';

const seen = new WeakSet<AnyStateMachine>();

Expand Down

0 comments on commit ae76918

Please sign in to comment.