Skip to content

Commit

Permalink
add isWired() method
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Jun 13, 2016
1 parent 4bc5507 commit 898f054
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion index.js
Expand Up @@ -61,6 +61,11 @@ function proxifyOnReadyStateChange(xhr) {
}
}


exports.isWired = function() {
return wired;
}

exports.wire = function() {
if ( wired ) throw new Error("Ajax interceptor already wired");

Expand Down Expand Up @@ -91,4 +96,4 @@ exports.unwire = function() {
if ( !wired ) throw new Error("Ajax interceptor not currently wired");
XMLHttpRequest.prototype.send = RealXHRSend;
wired = false;
};
};
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ajax-interceptor",
"version": "1.0.0",
"version": "1.0.1",
"description": "Permits to intercept Ajax calls. Useful to detect disconnected user or things like that",
"keywords": [
"xhr",
Expand Down

0 comments on commit 898f054

Please sign in to comment.