1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

Switch to Native Promises, add polyfills.js in dist folder

This commit is contained in:
Fred Chasen 2016-10-27 00:46:56 +02:00
parent a4e76029d4
commit 151dc97d19
28 changed files with 677 additions and 3049 deletions

View file

@ -1,4 +1,3 @@
var RSVP = require('rsvp');
var core = require('./core');
function Queue(_context){
@ -26,7 +25,7 @@ Queue.prototype.enqueue = function() {
if(typeof task === "function"){
deferred = new RSVP.defer();
deferred = new core.defer();
promise = deferred.promise;
queued = {
@ -88,7 +87,7 @@ Queue.prototype.dequeue = function(){
}
} else {
inwait = new RSVP.defer();
inwait = new core.defer();
inwait.deferred.resolve();
return inwait.promise;
}
@ -108,7 +107,7 @@ Queue.prototype.run = function(){
if(!this.running){
this.running = true;
this.defered = new RSVP.defer();
this.defered = new core.defer();
}
this.tick.call(window, function() {
@ -174,7 +173,7 @@ function Task(task, args, context){
return function(){
var toApply = arguments || [];
return new RSVP.Promise(function(resolve, reject) {
return new Promise(function(resolve, reject) {
var callback = function(value){
resolve(value);
};