Permalink
Browse files

now.ready always works now

  • Loading branch information...
ericz committed Apr 9, 2011
1 parent 913a529 commit f6e5ffa2f638bb3f7f85fafd749062e12c46245d
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/now.js
View
@@ -189,7 +189,15 @@ var nowLib = {
now[key] = nowOld[key];
}
now.core = core;
-
+ now.ready = function(func){
+ if(func && typeof func === "function") {
+ func();
+ } else {
+ nowCore.emit('ready');
+ }
+ }
+
+
setTimeout(function(){
nowCore.watchers[SERVER_ID].processScope();
}, 1000);

0 comments on commit f6e5ffa

Please sign in to comment.