GeoNode/geonode-viewer

View on GitHub
src/state/server/reducers.js

Summary

Maintainability
A
1 hr
Test Coverage
import {GET_SERVER_URL, SET_SERVER_URL} from '../actiontypes';

const defaultState = {
  url: undefined
}

const server = (state = defaultState, action) => {
  switch(action.type) {
    case GET_SERVER_URL:
      return state.url;
    case SET_SERVER_URL:
      return Object.assign({}, state, {
        url: action.url
      });
    default:
      return state;
  }
};
export default server;