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