Skip to content

Commit 9d82b94

Browse files
committed
feat(marbletoken): define tokens for marble diagram DSL
1 parent 299d66c commit 9d82b94

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

src/marbles/ObservableMarbleToken.ts

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* Defines tokens for marble diagram DSL to represent Observables.
3+
*
4+
*/
5+
export enum ObservableMarbleToken {
6+
/**
7+
* The passage of time without any events
8+
*/
9+
TIMEFRAME = '-',
10+
/**
11+
* Error
12+
*/
13+
ERROR = '#',
14+
/**
15+
* Whitespace does nothing, for aligning between marbles
16+
*
17+
*/
18+
NOOP = ' ',
19+
/**
20+
* Indicates start emitting simultaneouly.
21+
* Values between SIMULTANEOUS_START and SIMULTANEOUS_END considered to be
22+
* emitted simultaneously.
23+
*
24+
*/
25+
SIMULTANEOUS_START = '(',
26+
/**
27+
* Indicates end emitting simultaneouly.
28+
* Values between SIMULTANEOUS_START and SIMULTANEOUS_END considered to be
29+
* emitted simultaneously.
30+
*/
31+
SIMULTANEOUS_END = ')',
32+
/**
33+
* Indicates time passed multiple times of TIMEFRAME.
34+
* This token is single token, actual usage should be like
35+
* `...${n}...` , represents timeframe of `-` * n times.
36+
*
37+
*/
38+
TIMEFRAME_EXPAND = '.',
39+
/**
40+
* Completion of the stream
41+
*/
42+
COMPLETE = '|'
43+
}
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Defines tokens for marble diagram DSL to represent Observable subscriptions.
3+
*
4+
*/
5+
export enum SubscriptionMarbleToken {
6+
/**
7+
* Subscription started
8+
*/
9+
10+
SUBSCRIBE = '^',
11+
/**
12+
* Unsubscribed.
13+
*
14+
*/
15+
UNSUBSCRIBE = '!'
16+
}

0 commit comments

Comments
 (0)