src/Draggable/Plugins/Mirror/Mirror.js
function withPromise(callback, {raf = false} = {}) {
  return new Promise((resolve, reject) => {
    if (raf) {
      requestAnimationFrame(() => {
        callback(resolve, reject);
      });
    } else {
      callback(resolve, reject);
    }
  });
}
function withPromise(callback, {raf = false} = {}) {
  return new Promise((resolve, reject) => {
    if (raf) {
      requestAnimationFrame(() => {
        callback(resolve, reject);
      });
    } else {
      callback(resolve, reject);
    }
  });
}
function withPromise ( callback , { raf = false } = { } ) { return new Promise ( ( resolve , reject ) => { if ( raf ) { requestAnimationFrame ( ( ) => { callback ( resolve , reject ) ; } ) ; } else { callback ( resolve , reject ) ; } } ) ; }
Wraps functions in promise with potential animation frame option
@param {Function} callback
@param {Object} options
@param {Boolean} options.raf
@return {Promise}
@private
Wraps functions in promise with potential animation frame option