forked from jakesgordon/javascript-state-machine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwizard.js
More file actions
18 lines (15 loc) · 694 Bytes
/
wizard.js
File metadata and controls
18 lines (15 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var StateMachine = require('../src/app'),
visualize = require('../src/plugin/visualize');
var Wizard = StateMachine.factory({
init: 'A',
transitions: [
{ name: 'step', from: 'A', to: 'B', dot: { headport: 'w', tailport: 'ne' } },
{ name: 'step', from: 'B', to: 'C', dot: { headport: 'w', tailport: 'e' } },
{ name: 'step', from: 'C', to: 'D', dot: { headport: 'w', tailport: 'e' } },
{ name: 'reset', from: [ 'B', 'C', 'D' ], to: 'A', dot: { headport: 'se', tailport: 's' } }
]
});
Wizard.visualize = function() {
return visualize(Wizard, { name: 'wizard', orientation: 'horizontal' })
}
module.exports = Wizard