Skip to content

Commit 15cabf8

Browse files
committed
dispatcher: update to use enum
1 parent 02428a0 commit 15cabf8

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

client/utils/dispatcher.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@ const frames: {
66
} = {};
77
let frameIndex = 1;
88

9-
/** Codesandbox dispatcher message types */
10-
export const MessageTypes = {
11-
START: 'START',
12-
STOP: 'STOP',
13-
FILES: 'FILES',
14-
SKETCH: 'SKETCH',
15-
REGISTER: 'REGISTER',
16-
EXECUTE: 'EXECUTE'
17-
} as const;
18-
19-
/** Codesandbox dispatcher message types */
20-
export type MessageType = typeof MessageTypes[keyof typeof MessageTypes];
9+
/* eslint-disable no-shadow */
10+
/** Codesandbox dispatcher message types: */
11+
export enum MessageTypes {
12+
START = 'START',
13+
STOP = 'STOP',
14+
FILES = 'FILES',
15+
SKETCH = 'SKETCH',
16+
REGISTER = 'REGISTER',
17+
EXECUTE = 'EXECUTE'
18+
}
19+
/* eslint-enable no-shadow */
2120

2221
/**
2322
* Codesandbox dispatcher message
2423
* - type: 'START', 'STOP' etc
2524
* - payload: additional data for that message type
2625
*/
2726
export type Message = {
28-
type: MessageType;
27+
type: MessageTypes;
2928
payload?: any;
3029
};
3130

0 commit comments

Comments
 (0)