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

Is the data type of the status value not allowed to be int? #191

Open
phpstudyone opened this issue Dec 31, 2019 · 1 comment
Open

Is the data type of the status value not allowed to be int? #191

phpstudyone opened this issue Dec 31, 2019 · 1 comment

Comments

@phpstudyone
Copy link

image

The data type of the status value is not allowed to be int?

const StateMachine = require('javascript-state-machine');
var fsm = new StateMachine({
    init: 1,
    transitions: [
      { name: 'melt',     from: 1, to: 2 },
      { name: 'freeze',   from: 2, to:3  },
      { name: 'vaporize', from: 3, to: 4 },
      { name: 'condense', from: 4, to: 5 }
    ],
    methods: {
      onMelt:     function(t) { console.log('I melted',t,this)    },
      onFreeze:   function() { console.log('I froze')     },
      onVaporize: function() { console.log('I vaporized') },
      onCondense: function() { console.log('I condensed') }
    }
});

fsm.melt();
@rahulyadav
Copy link

I'm also facing the same issue

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