Skip to content

Commit db9d8ab

Browse files
committed
Change TransitionMap to be total.
1 parent 7bbf198 commit db9d8ab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/timer.cubing.net/timing/Controller.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ enum State {
1212
Ignore = "ignore",
1313
}
1414

15-
type TransitionMap = Partial<Record<State, State>>;
15+
type TransitionMap = Record<State, State>;
1616

1717
export class Controller {
1818
private timer: Timer;
@@ -81,6 +81,7 @@ export class Controller {
8181
[State.Running]: State.Stopped,
8282
[State.Stopped]: State.Ignore,
8383
[State.Done]: State.ReadyDown,
84+
[State.Ignore]: State.Ignore,
8485
};
8586
this.setState(transitionMap[this.state]);
8687
}
@@ -93,6 +94,7 @@ export class Controller {
9394
[State.Running]: State.Ignore,
9495
[State.Stopped]: State.Done,
9596
[State.Done]: State.Ignore,
97+
[State.Ignore]: State.Ignore,
9698
};
9799
this.setState(transitionMap[this.state]);
98100
}

0 commit comments

Comments
 (0)