We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c51a69f + ad0a6e3 commit 0fb41a8Copy full SHA for 0fb41a8
1 file changed
classes/switchmanager.ts
@@ -0,0 +1,20 @@
1
+namespace switchblock {
2
+ class SwitchManager {
3
+ private switches: { [name: string]: SwitchContext } = {};
4
+
5
+ create(name: string): SwitchContext {
6
+ const ctx = new SwitchContext();
7
+ this.switches[name] = ctx;
8
+ return ctx;
9
+ }
10
11
+ get(name: string): SwitchContext {
12
+ return this.switches[name];
13
14
15
+ debug(name: string): void {
16
+ const ctx = this.switches[name];
17
+ console.log(`Switch "${name}" has ${ctx.caseCount()} cases`);
18
19
20
+}
0 commit comments