Skip to content

Commit

Permalink
Merge pull request #105 from ArtskydJ/remove-once
Browse files Browse the repository at this point in the history
Remove `once` dependency
  • Loading branch information
naugtur committed Jun 4, 2016
2 parents 341450e + 56f91b7 commit a34cec3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use strict";
var window = require("global/window")
var once = require("once")
var isFunction = require("is-function")
var parseHeaders = require("parse-headers")
var xtend = require("xtend")
Expand Down Expand Up @@ -56,7 +55,6 @@ function _createXHR(options) {
if(typeof callback === "undefined"){
throw new Error("callback argument missing")
}
callback = once(callback)

function readystatechange() {
if (xhr.readyState === 4) {
Expand Down Expand Up @@ -99,6 +97,7 @@ function _createXHR(options) {
}
evt.statusCode = 0
callback(evt, failureResponse)
callback = noop
}

// will load the data & process the response in a special response object
Expand Down Expand Up @@ -131,6 +130,7 @@ function _createXHR(options) {
err = new Error("Internal XMLHttpRequest Error")
}
callback(err, response, response.body)
callback = noop

}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"dependencies": {
"global": "~4.3.0",
"is-function": "^1.0.1",
"once": "~1.1.1",
"parse-headers": "^2.0.0",
"xtend": "^4.0.0"
},
Expand Down

0 comments on commit a34cec3

Please sign in to comment.