import Ember from 'ember';

const { RSVP, run } = Ember;

export function wrap(callback, label) {
  return new RSVP.Promise((resolve, reject) => {
    callback().then(run.bind(null, resolve), run.bind(null, reject));
  }, label);
}
