text: import {createSelector} from "reselect";
  
  import NameSpace from "../name-space";
  
  export const getQuestions = (state) => {
    return state[NameSpace.DATA].questions;
  };
  
  const randomFilter = () => {
    return Math.random() > 0.5;
  };
  
  export const getArtistQuestions = createSelector(
      getQuestions,
      randomFilter,
      (resultOne, resultTwo) => {
        return resultOne.filter((item) => resultTwo && item.type === `artist`);
      }
  );
  
  export const getGenreQuestions = createSelector(
      getQuestions,
      (questions) => {
        return questions.filter((item) => item.type === `genre`);
      }
  );
  