import { createSelector } from 'reselect';

var selectApp = function selectApp(state) {
  return state.app;
};

var selectRouting = function selectRouting(state) {
  return selectApp(state).routing;
};

var selectDisplay = function selectDisplay(state) {
  return selectApp(state).display;
};

var selectStatus = function selectStatus(state) {
  return selectApp(state).status;
}; // routing


export var getHash = function getHash() {
  return createSelector(selectRouting, function (x) {
    return x.hash;
  });
};
export var getRoutes = function getRoutes() {
  return createSelector(selectRouting, function (x) {
    return x.routes;
  });
};
export var getContactLink = function getContactLink() {
  return createSelector(selectRouting, function (x) {
    return x.contactLink;
  });
}; // display

export var getIsMobileOpen = function getIsMobileOpen() {
  return createSelector(selectDisplay, function (x) {
    return x.isMobileOpen;
  });
};
export var getIsSettingsOpen = function getIsSettingsOpen() {
  return createSelector(selectDisplay, function (x) {
    return x.isSettingsOpen;
  });
}; // status

export var getIsLoading = function getIsLoading() {
  return createSelector(selectStatus, function (x) {
    return x.isLoading;
  });
};
export var getError = function getError() {
  return createSelector(selectStatus, function (x) {
    return x.error;
  });
};