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

Maximum call stack size exceeded error #6

Closed
josmithua opened this issue Aug 19, 2021 · 4 comments
Closed

Maximum call stack size exceeded error #6

josmithua opened this issue Aug 19, 2021 · 4 comments

Comments

@josmithua
Copy link

I'm getting Maximum call stack size exceeded error when using always to go back and forth between states, even though they have conds:

    states: {
      noneSelected: {
        always: {
          target: 'someSelected',
          cond: (ctx) => ctx.selected.length > 0,
        },
      },
      someSelected: {
        on: {
          PRINT: { actions: 'printSelected' },
          COPY: { actions: 'copySelected' },
          DESELECT_ALL: { actions: 'clearSelected' },
        },
        always: {
          target: 'noneSelected',
          cond: (ctx) => ctx.selected.length === 0,
        },
      },
    },
@damiensedgwick
Copy link

I'm getting Maximum call stack size exceeded error when using always to go back and forth between states, even though they have conds:

    states: {
      noneSelected: {
        always: {
          target: 'someSelected',
          cond: (ctx) => ctx.selected.length > 0,
        },
      },
      someSelected: {
        on: {
          PRINT: { actions: 'printSelected' },
          COPY: { actions: 'copySelected' },
          DESELECT_ALL: { actions: 'clearSelected' },
        },
        always: {
          target: 'noneSelected',
          cond: (ctx) => ctx.selected.length === 0,
        },
      },
    },

Do you mind sharing the whole machine or saving it and sharing a link to it please?

@josmithua
Copy link
Author

Hi Damien, I just tried it again and it seems the errors are gone. Here's the link anyways: https://stately.ai/viz/546432e7-c837-46fa-94f8-7c430ffb5493

@damiensedgwick
Copy link

Hi Damien, I just tried it again and it seems the errors are gone. Here's the link anyways: https://stately.ai/viz/546432e7-c837-46fa-94f8-7c430ffb5493

My work here is done 🤣

@josmithua
Copy link
Author

Amazing, thank you 🤣

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