1 | import { StateNode } from './StateNode.js';
|
2 | import { IS_PRODUCTION } from './environment.js';
|
3 |
|
4 | var warned = false;
|
5 | function Machine(config, options, initialContext) {
|
6 | if (initialContext === void 0) {
|
7 | initialContext = config.context;
|
8 | }
|
9 |
|
10 | return new StateNode(config, options, initialContext);
|
11 | }
|
12 | function createMachine(config, options) {
|
13 | if (!IS_PRODUCTION && !('predictableActionArguments' in config) && !warned) {
|
14 | warned = true;
|
15 | console.warn('It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html');
|
16 | }
|
17 |
|
18 | return new StateNode(config, options);
|
19 | }
|
20 |
|
21 | export { Machine, createMachine };
|