Permalink
Browse files

Added proper useSync to the YUI module itself

  • Loading branch information...
1 parent de4e2e4 commit 184e7690f00d9fbd6f8fd2bc5d61d7f5c20b4b88 @davglass davglass committed Nov 20, 2010
Showing with 13 additions and 3 deletions.
  1. +7 −0 examples/sync-mod.js
  2. +1 −3 examples/sync-module.js
  3. +5 −0 lib/node-yui3.js
View
7 examples/sync-mod.js
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+var Y = require('./sync-module');
+
+Y.YQL('select * from github.user.info where (id = "davglass")', function(r) {
+ //Do something here.
+ Y.log(r.query, 'debug', 'yql');
+});
View
4 examples/sync-module.js
@@ -2,8 +2,6 @@
var YUI = require("yui3").YUI;
-YUI.loadSync = true;
-
YUI({
filter: 'debug',
_logExclude: {
@@ -16,7 +14,7 @@ YUI({
'event': true
},
debug: true
-}).use('yql', function(Ysync) {
+}).useSync('yql', function(Ysync) {
module.exports = Ysync;
View
5 lib/node-yui3.js
@@ -258,6 +258,11 @@ YUI.prototype.fetch = function(url, o) {
};
+YUI.prototype.useSync = function() {
+ YUI.loadSync = true;
+ return this.use.apply(this, arguments);
+}
+
YUI.prototype.__use = YUI.prototype.use;
YUI.prototype.use = function() {

0 comments on commit 184e769

Please sign in to comment.