blob: da6aa94a55f808bf7c4eed52331f1eb6e1ea2207 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
import {OPEN_EXPERIMENT_SUCCEEDED} from "../actions/experiments";
import {CHANGE_LOAD_METRIC} from "../actions/simulation/load-metric";
import {SET_PLAYING} from "../actions/simulation/playback";
import {GO_TO_TICK, SET_LAST_SIMULATED_TICK} from "../actions/simulation/tick";
export function currentExperimentId(state = -1, action) {
switch (action.type) {
case OPEN_EXPERIMENT_SUCCEEDED:
return action.id;
default:
return state;
}
}
export function currentTick(state = 0, action) {
switch (action.type) {
case GO_TO_TICK:
return action.tick;
default:
return state;
}
}
export function loadMetric(state = "LOAD", action) {
switch (action.type) {
case CHANGE_LOAD_METRIC:
return action.metric;
default:
return state;
}
}
export function isPlaying(state = false, action) {
switch (action.type) {
case SET_PLAYING:
return action.playing;
default:
return state;
}
}
export function lastSimulatedTick(state = -1, action) {
switch (action.type) {
case SET_LAST_SIMULATED_TICK:
return action.tick;
default:
return state;
}
}
|