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

Typings for fromMachine are Incompatible #1

Closed
christoph-fricke opened this issue Oct 1, 2021 · 0 comments · Fixed by #2
Closed

Typings for fromMachine are Incompatible #1

christoph-fricke opened this issue Oct 1, 2021 · 0 comments · Fixed by #2
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@christoph-fricke
Copy link
Owner

fromMachine is used to convert a state machine to a behavior so it can be used with higher-order-behavior defined by this library.

However, it is currently not possible to pass a machine that is created with createMachine or model.createMachine to fromMachine. TypeScript produces some type errors that I don't fully understand yet.

Relevant source: https://github.com/christoph-fricke/xsystem/blob/main/src/utils/from_machine.ts
Test that should not produce errors if TS comment is removed: https://github.com/christoph-fricke/xsystem/blob/main/src/utils/from_machine.test.ts

@christoph-fricke christoph-fricke added bug Something isn't working help wanted Extra attention is needed labels Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant