Skip to content

Commit 0c89c96

Browse files
committed
Merge branch 'main' into next
# Conflicts: # .changeset/poor-ducks-join.md # packages/core/src/model.types.ts # packages/core/src/typegenTypes.ts # packages/core/src/types.ts # packages/core/test/types.test.ts # packages/xstate-svelte/package.json # packages/xstate-svelte/src/useMachine.ts
2 parents 7a68cbb + eb7856e commit 0c89c96

38 files changed

+421
-301
lines changed

.changeset/cool-ducks-pretend.md

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

.changeset/fast-ways-run.md

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

.changeset/poor-ducks-join.md

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

.changeset/serious-melons-fold.md

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

.changeset/stupid-plums-smile.md

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

.changeset/tasty-chicken-itch.md

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

.github/workflows/nodejs.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Node CI
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- next
8+
pull_request:
9+
branches:
10+
- '**'
411

512
jobs:
613
build:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ JavaScript and TypeScript [finite state machines](https://en.wikipedia.org/wiki/
1818

1919
💙 [Explore our catalogue of examples](https://xstate-catalogue.com/)
2020

21+
➡️ [Create state machines with the Stately Editor](https://stately.ai/editor)
22+
2123
🖥 [Download our VS Code extension](https://marketplace.visualstudio.com/items?itemName=statelyai.stately-vscode)
2224

2325
📑 Adheres to the [SCXML specification](https://www.w3.org/TR/scxml/)

docs/fr/packages/xstate-react/index.md

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -224,52 +224,6 @@ const App = ({ service }) => {
224224
};
225225
```
226226

227-
### `asEffect(action)`
228-
229-
Ensures that the `action` is executed as an effect in `useEffect`, rather than being immediately executed.
230-
231-
**Arguments**
232-
233-
- `action` - An action function (e.g., `(context, event) => { alert(context.message) })`)
234-
235-
**Returns** a special action function that wraps the original so that `useMachine` knows to execute it in `useEffect`.
236-
237-
**Example**
238-
239-
```jsx
240-
const machine = createMachine({
241-
initial: 'focused',
242-
states: {
243-
focused: {
244-
entry: 'focus'
245-
}
246-
}
247-
});
248-
249-
const Input = () => {
250-
const inputRef = useRef(null);
251-
const [state, send] = useMachine(machine, {
252-
actions: {
253-
focus: asEffect((context, event) => {
254-
inputRef.current && inputRef.current.focus();
255-
})
256-
}
257-
});
258-
259-
return <input ref={inputRef} />;
260-
};
261-
```
262-
263-
### `asLayoutEffect(action)`
264-
265-
Ensures that the `action` is executed as an effect in `useLayoutEffect`, rather than being immediately executed.
266-
267-
**Arguments**
268-
269-
- `action` - An action function (e.g., `(context, event) => { alert(context.message) })`)
270-
271-
**Returns** a special action function that wraps the original so that `useMachine` knows to execute it in `useLayoutEffect`.
272-
273227
### `useMachine(machine)` with `@xstate/fsm`
274228

275229
A [React hook](https://reactjs.org/hooks) that interprets the given finite state `machine` from [`@xstate/fsm`] and starts a service that runs for the lifetime of the component.

docs/guides/actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ const machine = createMachine({
679679
680680
A [self-transition](./transitions.md#self-transitions) is when a state transitions to itself, in which it _may_ exit and then reenter itself. Self-transitions can either be an **internal** or **external** transition:
681681
682-
- An internal transition will _not_ exit and reenter itself, so the state node's `entry` and `exit` actions will not be executed again.
682+
- An internal transition will _neither_ exit nor reenter itself, so the state node's `entry` and `exit` actions will not be executed again.
683683
- Internal transitions are indicated with `{ internal: true }`, or by leaving the `target` as `undefined`.
684684
- Actions defined on the transition's `actions` property will be executed.
685685
- An external transition _will_ exit and reenter itself, so the state node's `entry` and `exit` actions will be executed again.

0 commit comments

Comments
 (0)