diff options
| author | Georgios Andreadis <G.Andreadis@student.tudelft.nl> | 2017-10-04 23:23:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-04 23:23:09 +0200 |
| commit | fcaaae65d34003874c76e0c01134dedf94248e09 (patch) | |
| tree | 2aae1422168651e832a1904623f6f5b100fc17ec /src/reducers/simulation-list.js | |
| parent | 0a62dfb55c5700013d42a589b930c7448e5bff71 (diff) | |
| parent | 606d1de0be09f3597165248f65d54e158a13860c (diff) | |
Merge pull request #42 from atlarge-research/auto-reformat
Standardize code format
Diffstat (limited to 'src/reducers/simulation-list.js')
| -rw-r--r-- | src/reducers/simulation-list.js | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/src/reducers/simulation-list.js b/src/reducers/simulation-list.js index 86386093..9afa3586 100644 --- a/src/reducers/simulation-list.js +++ b/src/reducers/simulation-list.js @@ -1,37 +1,34 @@ -import {combineReducers} from "redux"; +import { combineReducers } from "redux"; import { - ADD_SIMULATION_SUCCEEDED, - DELETE_SIMULATION_SUCCEEDED, - SET_AUTH_VISIBILITY_FILTER + ADD_SIMULATION_SUCCEEDED, + DELETE_SIMULATION_SUCCEEDED, + SET_AUTH_VISIBILITY_FILTER } from "../actions/simulations"; -import {FETCH_AUTHORIZATIONS_OF_CURRENT_USER_SUCCEEDED} from "../actions/users"; +import { FETCH_AUTHORIZATIONS_OF_CURRENT_USER_SUCCEEDED } from "../actions/users"; export function authorizationsOfCurrentUser(state = [], action) { - switch (action.type) { - case FETCH_AUTHORIZATIONS_OF_CURRENT_USER_SUCCEEDED: - return action.authorizationsOfCurrentUser; - case ADD_SIMULATION_SUCCEEDED: - return [ - ...state, - action.authorization - ]; - case DELETE_SIMULATION_SUCCEEDED: - return state.filter(authorization => authorization[1] !== action.id); - default: - return state; - } + switch (action.type) { + case FETCH_AUTHORIZATIONS_OF_CURRENT_USER_SUCCEEDED: + return action.authorizationsOfCurrentUser; + case ADD_SIMULATION_SUCCEEDED: + return [...state, action.authorization]; + case DELETE_SIMULATION_SUCCEEDED: + return state.filter(authorization => authorization[1] !== action.id); + default: + return state; + } } export function authVisibilityFilter(state = "SHOW_ALL", action) { - switch (action.type) { - case SET_AUTH_VISIBILITY_FILTER: - return action.filter; - default: - return state; - } + switch (action.type) { + case SET_AUTH_VISIBILITY_FILTER: + return action.filter; + default: + return state; + } } export const simulationList = combineReducers({ - authorizationsOfCurrentUser, - authVisibilityFilter, + authorizationsOfCurrentUser, + authVisibilityFilter }); |
