"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.onNextFrame = onNextFrame;
exports.clearNextFrameAction = clearNextFrameAction;

function onNextFrame(cb) {
  if (window.requestAnimationFrame) {
    return window.requestAnimationFrame(cb);
  }

  return window.setTimeout(cb, 1);
}

function clearNextFrameAction(nextFrameId) {
  if (window.cancelAnimationFrame) {
    window.cancelAnimationFrame(nextFrameId);
  } else {
    window.clearTimeout(nextFrameId);
  }
}