diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-28 22:48:38 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-28 22:48:38 +0200 |
| commit | bcf119f2c4ac587cc8263db8a9fc0581521fdec7 (patch) | |
| tree | c7c78a13d575b8345d729bb5aa44022d7f0715d4 /src/sagas/experiments.js | |
| parent | f29305d4c966af83a0a842f78dcb7adb7128b37c (diff) | |
Implement batch state adding
Also fixes the 'hidden states' bug.
Diffstat (limited to 'src/sagas/experiments.js')
| -rw-r--r-- | src/sagas/experiments.js | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/sagas/experiments.js b/src/sagas/experiments.js index 84a748da..f21bb336 100644 --- a/src/sagas/experiments.js +++ b/src/sagas/experiments.js @@ -2,7 +2,7 @@ import {delay} from "redux-saga"; import {call, put, select} from "redux-saga/effects"; import {addPropToStoreObject, addToStore} from "../actions/objects"; import {setLastSimulatedTick} from "../actions/simulation/tick"; -import {addToStates} from "../actions/states"; +import {addBatchToStates} from "../actions/states"; import { deleteExperiment, getAllMachineStates, @@ -48,10 +48,10 @@ function* startStateFetchLoop(experimentId) { const rackStates = yield call(getAllRackStates, experimentId); const roomStates = yield call(getAllRoomStates, experimentId); - yield addAllStates("task", taskStates); - yield addAllStates("machine", machineStates); - yield addAllStates("rack", rackStates); - yield addAllStates("room", roomStates); + yield put(addBatchToStates("task", taskStates)); + yield put(addBatchToStates("machine", machineStates)); + yield put(addBatchToStates("rack", rackStates)); + yield put(addBatchToStates("room", roomStates)); yield delay(5000); } else { @@ -63,12 +63,6 @@ function* startStateFetchLoop(experimentId) { } } -function* addAllStates(objectType, states) { - for (let i in states) { - yield put(addToStates(objectType, states[i].tick, states[i])); - } -} - export function* onFetchExperimentsOfSimulation() { try { const currentSimulationId = yield select(state => state.currentSimulationId); |
