import { window } from 'global';

export function setCachedResults(output, performance) {
  return window._graphQLExplorerCachedResults = {
    output: output,
    performance: performance
  }
}

export function getCachedResults(query) {
  return window._graphQLExplorerCachedResults;
}

let cachedResults = null;

export function setCachedResults(output, performance) {
  return cachedResults = {
    output: output,
    performance: performance
  }
}

export function getCachedResults(query) {
  return cachedResults;
}

Use a local variable instead of window for the resutls cache
Use a local variable instead of window for the resutls cache
