old_contents: // Inspired by https://gist.github.com/paulirish/1579671
  
  export let requestAnimationFrame;
  export let cancelAnimationFrame;
  
  let lastTime = 0;
  
  if(typeof window != 'undefined') {
    requestAnimationFrame = window.requestAnimationFrame;
    cancelAnimationFrame = window.cancelAnimationFrame;
  
    const vendors = ['ms', 'moz', 'webkit', 'o'];
    for (let x = 0; x < vendors.length && !requestAnimationFrame; ++x) {
      requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
      cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||
        window[vendors[x] + 'CancelRequestAnimationFrame'];
    }
  }
  
  if (!requestAnimationFrame) {
    requestAnimationFrame = (callback) => {
      const currTime = new Date().getTime();
      const timeToCall = Math.max(0, 16 - (currTime - lastTime));
      const id = window.setTimeout(() => {
        callback(currTime + timeToCall);
      }, timeToCall);
      lastTime = currTime + timeToCall;
      return id;
    };
  }
  
  if (!cancelAnimationFrame) {
    cancelAnimationFrame = (id) => {
      clearTimeout(id);
    };
  }
  
new_contents: // Inspired by https://gist.github.com/paulirish/1579671
  
  import { canUseDOM } from 'react/lib/ExecutionEnvironment';
  
  export let requestAnimationFrame;
  export let cancelAnimationFrame;
  
  let lastTime = 0;
  
  if (canUseDOM) {
    requestAnimationFrame = window.requestAnimationFrame;
    cancelAnimationFrame = window.cancelAnimationFrame;
  
    const vendors = ['ms', 'moz', 'webkit', 'o'];
    for (let x = 0; x < vendors.length && !requestAnimationFrame; ++x) {
      requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
      cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||
        window[vendors[x] + 'CancelRequestAnimationFrame'];
    }
  }
  
  if (!requestAnimationFrame) {
    requestAnimationFrame = (callback) => {
      const currTime = new Date().getTime();
      const timeToCall = Math.max(0, 16 - (currTime - lastTime));
      const id = window.setTimeout(() => {
        callback(currTime + timeToCall);
      }, timeToCall);
      lastTime = currTime + timeToCall;
      return id;
    };
  }
  
  if (!cancelAnimationFrame) {
    cancelAnimationFrame = (id) => {
      clearTimeout(id);
    };
  }
  
subject: switch to canUseDom