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

Commit 85210bc

Browse files
committed
add invoke and invokeArray api
1 parent 9e7466c commit 85210bc

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

js.js

Lines changed: 11 additions & 2 deletions
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 2.5
5+
@version 2.6
66
@link http://github.com/redcatphp/js/
77
@author Jo Surikat <jo@surikat.pro>
88
@website http://redcatphp.com
@@ -638,7 +638,16 @@
638638
}
639639
}
640640
};
641-
641+
js.invokeArray = function(mod,args){
642+
return $js(mod,function(){
643+
$js.module(mod).apply(null,args);
644+
});
645+
};
646+
js.invoke = function(){
647+
var args = Array.prototype.slice.call(arguments);
648+
var mod = args.shift();
649+
return $js.invokeArray(mod,args);
650+
};
642651
return js;
643652
})();
644653
var y = {};

0 commit comments

Comments
 (0)