text: /**
   * The global state selectors
   */
  
  import { createSelector } from 'reselect';
  
  const selectGlobal = () => (state) => state.get('global');
  
  const selectCurrentQuery = () => createSelector(
    selectGlobal(),
    (globalState) => globalState.get('currentQuery')
  );
  
  const selectLoading = () => createSelector(
    selectGlobal(),
    (globalState) => globalState.get('loading')
  );
  
  const selectError = () => createSelector(
    selectGlobal(),
    (globalState) => globalState.get('error')
  );
  
  const selectPosts = () => createSelector(
    selectGlobal(),
    (globalState) => globalState.getIn(['posts'])
  );
  
  const selectLocationState = () => {
    let prevRoutingState;
    let prevRoutingStateJS;
  
    return (state) => {
      const routingState = state.get('route'); // or state.route
  
      if (!routingState.equals(prevRoutingState)) {
        prevRoutingState = routingState;
        prevRoutingStateJS = routingState.toJS();
      }
  
      return prevRoutingStateJS;
    };
  };
  
  export {
    selectGlobal,
    selectCurrentQuery,
    selectLoading,
    selectError,
    selectPosts,
    selectLocationState,
  };
  