()
| 15 | }; |
| 16 | |
| 17 | var refreshUI = function() { |
| 18 | setTimeout(function() { |
| 19 | demo.className = fsm.state; |
| 20 | panic.disabled = fsm.cannot('panic', true); |
| 21 | warn.disabled = fsm.cannot('warn', true); |
| 22 | calm.disabled = fsm.cannot('calm', true); |
| 23 | clear.disabled = fsm.cannot('clear', true); |
| 24 | }, 0); // defer until end of current tick to allow fsm to complete transaction |
| 25 | }; |
| 26 | |
| 27 | var fsm = new StateMachine({ |
| 28 |