TypeScript in example
This commit is contained in:
@@ -3,10 +3,10 @@ import { Machine, State, On, Do, Goto, Spawn, Unspawn } from '../index';
|
|||||||
const beginTimer = ()=>{};
|
const beginTimer = ()=>{};
|
||||||
|
|
||||||
type S = 'green' | 'yellow' | 'red';
|
type S = 'green' | 'yellow' | 'red';
|
||||||
type E = 'entry' | 'timer-finished';
|
type E = ['entry',null] | ['timer-finished',null];
|
||||||
|
|
||||||
const machine =
|
const machine =
|
||||||
Machine(
|
Machine<S,E>(
|
||||||
State('green',
|
State('green',
|
||||||
On('entry',
|
On('entry',
|
||||||
Do(beginTimer)
|
Do(beginTimer)
|
||||||
|
|||||||
Reference in New Issue
Block a user