Permalink
Browse files

mention the loader hook in the documentation

  • Loading branch information...
1 parent f920e67 commit f395b31238253c56155754e02c575746d720f2f7 @ekashida committed Mar 17, 2014
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/loader/js/loader.js
View
@@ -76,6 +76,19 @@ Y.Env.meta = META;
});
var out = loader.resolve(true);
+ * If the Loader needs to be patched before it is used for the first time, it
+ * should be done through the `doBeforeLoader` hook. Simply make the patch
+ * available via configuration before YUI is loaded:
+
+ YUI_config = YUI_config || {};
+ YUI_config.doBeforeLoader = function (config) {
+ var resolve = this.context.Loader.prototype.resolve;
+ this.context.Loader.prototype.resolve = function () {
+ // do something here
+ return resolve.apply(this, arguments);
+ };
+ };
+
* @constructor
* @class Loader
* @param {Object} config an optional set of configuration options.

0 comments on commit f395b31

Please sign in to comment.