-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Allow inline actor logic * Move the ts-expect-errors to more precise locations * disallow ids for invoked inline actors when actor types are configured * tweak spawn-related types * Add changeset --------- Co-authored-by: Mateusz Burzyński <[email protected]>
- Loading branch information
1 parent
4513ae8
commit f4e0ec4
Showing
6 changed files
with
350 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
'xstate': minor | ||
--- | ||
|
||
Inline actor logic is now permitted when named actors are present. Defining inline actors will no longer cause a TypeScript error: | ||
|
||
```ts | ||
const machine = setup({ | ||
actors: { | ||
existingActor: fromPromise(async () => { | ||
// ... | ||
}) | ||
} | ||
}).createMachine({ | ||
invoke: { | ||
src: fromPromise(async () => { | ||
// Inline actor | ||
}) | ||
// ... | ||
} | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.