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

Typegen doesn't compute actions listed in state after prop #44

Open
ptaranto opened this issue Jan 29, 2022 · 2 comments
Open

Typegen doesn't compute actions listed in state after prop #44

ptaranto opened this issue Jan 29, 2022 · 2 comments

Comments

@ptaranto
Copy link

When an action is only listed in state.after props, the following error myCustomAction is never used in the machine definition is marked in the action implementation as the action is not included in the typegen file

createMachine({
  ...
  myIntervalState: {
    after: [
      { delay: 1000, target: 'myInternalState', actions: ['myCustomAction']
    ]
  }
  ...
}, {
  actions: {
    myCustomAction: (context) => {...}
  }
})
@mattpocock
Copy link
Contributor

@ptaranto Is that valid syntax? After is usually declared like this:

after: {
  1000: { target, action }
}

@mattpocock
Copy link
Contributor

Ah you're right. Good catch!

image

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