Skip to content

Commit

Permalink
Merge pull request #2965 from satyasinha/satyasinha/improve-action-ex…
Browse files Browse the repository at this point in the history
…ports

improve exporting of 'actions'
  • Loading branch information
davidkpiano committed Jan 29, 2022
2 parents a391455 + 3230742 commit 43f4e91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 39 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-dolls-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'xstate': minor
---

All actions are now available in the `actions` variable when importing: `import { actions } from 'xstate'`
41 changes: 2 additions & 39 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,7 @@ import { StateNode } from './StateNode';
import { State } from './State';
import { Machine, createMachine } from './Machine';
import { Actor } from './Actor';
import {
raise,
send,
sendParent,
sendTo,
sendUpdate,
log,
cancel,
start,
stop,
assign,
after,
done,
respond,
doneInvoke,
forwardTo,
escalate,
choose,
pure
} from './actions';
import * as actions from './actions';
import {
interpret,
Interpreter,
Expand All @@ -33,25 +14,7 @@ import {
import { matchState } from './match';
import { createSchema, t } from './schema';

const actions = {
raise,
send,
sendParent,
sendTo,
sendUpdate,
log,
cancel,
start,
stop,
assign,
after,
done,
respond,
forwardTo,
escalate,
choose,
pure
};
const { assign, send, sendParent, sendUpdate, forwardTo, doneInvoke } = actions;

export {
Actor,
Expand Down

0 comments on commit 43f4e91

Please sign in to comment.