diff --git a/jquery.basic_arithmetics.js b/jquery.basic_arithmetics.js index 12d7cc4..12f0c25 100644 --- a/jquery.basic_arithmetics.js +++ b/jquery.basic_arithmetics.js @@ -28,7 +28,6 @@ } - $.subtract = function() { this.operate = function(i) { @@ -53,8 +52,6 @@ } - - $.multiply = function() { this.operate = function(i) { @@ -65,8 +62,7 @@ return this.result; } - - + $.equals = function() { this.operate = function(i) { @@ -79,6 +75,38 @@ Operation.apply(this, arguments); return this.result; - } + + } + + $.addAsync = function() { + + console.log(arguments) + return $.when($.add.apply(this, arguments)) + + } + + $.subtractAsync = function() { + + return $.when($.subtract.apply(this, arguments)) + + } + + $.divideAsync = function() { + + return $.when($.divide.apply(this, arguments)) + + } + + $.multiplyAsync = function() { + + return $.when($.multiply.apply(this, arguments)) + + } + + $.equalsAsync = function() { + + return $.when($.equals.apply(this, arguments)) + + } }(jQuery)); \ No newline at end of file diff --git a/jquery.basic_arithmetics.min.js b/jquery.basic_arithmetics.min.js index 24ddc17..259c939 100644 --- a/jquery.basic_arithmetics.min.js +++ b/jquery.basic_arithmetics.min.js @@ -1 +1 @@ -(function(e){var t=function(){this.operands=arguments;if(this.operands.length<2)throw new Error("You need at least two arguments.");for(var e=0;ethis.operands.length)throw new Error('You need at least two arguments.');for(var c=0;c