Skip to content

Instantly share code, notes, and snippets.

@unscriptable
Created May 16, 2011 19:56
Show Gist options
  • Save unscriptable/975207 to your computer and use it in GitHub Desktop.
Save unscriptable/975207 to your computer and use it in GitHub Desktop.
aop-ish way to detect when dojo.parser.parse is called
define(['dojo/parser, wire/Deferred'], function (parser, Promise) {
var orig = parser.parse,
promise = new Promise();
parser.parse = function (node) {
orig.apply(parser, arguments);
promise.resolve();
};
return promise;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment