diff options
Diffstat (limited to 'src/reducers/current-ids.js')
| -rw-r--r-- | src/reducers/current-ids.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/reducers/current-ids.js b/src/reducers/current-ids.js new file mode 100644 index 00000000..c94d7861 --- /dev/null +++ b/src/reducers/current-ids.js @@ -0,0 +1,23 @@ +import {OPEN_SIMULATION_SUCCEEDED} from "../actions/simulations"; +import {FETCH_LATEST_DATACENTER_SUCCEEDED, RESET_CURRENT_DATACENTER} from "../actions/topology/building"; + +export function currentDatacenterId(state = -1, action) { + switch (action.type) { + case FETCH_LATEST_DATACENTER_SUCCEEDED: + return action.datacenterId; + case RESET_CURRENT_DATACENTER: + return -1; + default: + return state; + } +} + +export function currentSimulationId(state = -1, action) { + switch (action.type) { + case OPEN_SIMULATION_SUCCEEDED: + return action.id; + default: + return state; + } +} + |
