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

options.observeUnchangedState - Am I supposed to use this? #183

Open
NelsonFrancisco opened this issue May 14, 2019 · 0 comments
Open

options.observeUnchangedState - Am I supposed to use this? #183

NelsonFrancisco opened this issue May 14, 2019 · 0 comments

Comments

@NelsonFrancisco
Copy link

Hello
So I needed a state machine in which a self loop would trigger a state entering method.
For example:

const fsm = new StateMachine({
  init: 'waiting',
  transitions: [
    { name: 'transferred', from: 'waiting', to: 'waiting' },
  ],
  methods: {
    onWaiting: function () { console.log('Im waiting') },
  },
})

The application was not logging twice when I tested this:

fsm.transferred()

So I appended to the object provided to the constructor, the following key:value pair
observeUnchangedState: true

Because I saw this condition in the source code.
So, will I get unexpected side effects when using this?
I'm asking because this is not documented.

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

1 participant