Skip to content
New issue

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

Support for @xstate/fsm #24

Open
tajakobsen opened this issue Jun 10, 2021 · 2 comments
Open

Support for @xstate/fsm #24

tajakobsen opened this issue Jun 10, 2021 · 2 comments

Comments

@tajakobsen
Copy link

tajakobsen commented Jun 10, 2021

Hi,

I'm planning to use @xstate/fsm in my project to get the bundle size down a bit, but I'm not able to use this addon when I replace the imports.

  // import { useMachine } from '@xstate/svelte'; // this works
  // import { createMachine } from 'xstate'; // this works
  import { useMachine } from '@xstate/svelte/lib/fsm'; // this doesn't work
  import { createMachine } from '@xstate/fsm'; // this doesn't work

(I'm using svelte too, but I don't think that makes a difference)

I'm just getting a message in "xState inspector" that says:

Waiting for connection...

@SimeonC
Copy link
Owner

SimeonC commented Jun 10, 2021

Hey, thanks for the report. I didn't test with fsm packages. They must use a different interpreter than the main xstate packages.

Not sure when I can get time to figure that out, if you want to have a go and send an PR the part that "turns on" the inspector is in this file src/preset/withXstateInspector.ts L24 an L38.

@tajakobsen
Copy link
Author

Hey,

I tried to google a bit, and it seems that fsm isn't supported by the vizualizer.

But I found a workaround where the config for fsm is passed into normal xstate – created only for the purpose of using it with the vizualizer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants