Skip to content
This repository was archived by the owner on Jan 24, 2019. It is now read-only.

Commit 4f9d498

Browse files
committed
add intercept api method
1 parent afb44be commit 4f9d498

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

js.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
$js - asynchronous module definition framework
33
or just simple lightweight javascript dependencies manager
44
5-
@version 4.0
5+
@version 4.1
66
@link http://github.com/redcatphp/js/
77
@author Jo Surikat <jo@surikat.pro>
88
@website http://redcatphp.com
@@ -750,6 +750,18 @@
750750
if(o.call)
751751
$js(o.call);
752752
};
753+
js.intercept = function(){
754+
var interceptor = {};
755+
intercepting = interceptor;
756+
return function(){
757+
if(!interceptor.callback){
758+
intercepting = false;
759+
}
760+
else{
761+
interceptor.callback();
762+
}
763+
};
764+
};
753765
return js;
754766
})();
755767
var y = {};

0 commit comments

Comments
 (0)