We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug
When calling:
getInitialSnapshot(machine, { param: "test" });
It gets called twice:
undefined
{ param: "test" }
Also, if the machine invokes another actor, it throws:
proxyConsole.js:64 Error: Actor with system ID 'child' already exists.
That getInitialSnapshot will initialize the machine once with the provided input.
getInitialSnapshot
import { createMachine, fromCallback, getInitialSnapshot } from "xstate"; const machine = createMachine({ context: ({ input }) => { console.log("input in context", input); return {}; }, invoke: { systemId: "child", src: fromCallback(() => {}), }, }); getInitialSnapshot(machine, { param: "test" });
https://codesandbox.io/p/sandbox/jolly-goodall-kg7858?file=%2Fsrc%2Findex.js
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug or feature request?
Bug
Description:
When calling:
It gets called twice:
undefined
{ param: "test" }
Also, if the machine invokes another actor, it throws:
Expected result:
That
getInitialSnapshot
will initialize the machine once with the provided input.Reproduction
https://codesandbox.io/p/sandbox/jolly-goodall-kg7858?file=%2Fsrc%2Findex.js
The text was updated successfully, but these errors were encountered: