diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-10-04 22:49:07 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-10-04 22:49:25 +0200 |
| commit | 751a9ef3a12c952fe179f256d854d0c4aa37e28e (patch) | |
| tree | 241fc22c592a277526e73cc70ea0f95d5a8a7b29 /src/reducers/simulation-list.js | |
| parent | 9257d89ec2e22b65ffecc7dc7cf67b7a74c34d60 (diff) | |
Apply prettier to codebase
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 }); |
