Skip to content

Commit

Permalink
add ready event
Browse files Browse the repository at this point in the history
  • Loading branch information
弈轩 committed Oct 24, 2012
1 parent fefff66 commit fd32d22
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ exports.create = function (prefix, conf, store) {

var _me = new Config();

/*{{{ check */
var check = function () {
setTimeout(function () {
if (store.get(prefix)) {
_me.emit('ready');
} else {
check();
}
},1000);
}
check();
/*}}}*/

/*{{{ sync() */
var sync = function (rev, callback) {
Expand All @@ -85,6 +97,7 @@ exports.create = function (prefix, conf, store) {
});
});


return _me;
};

0 comments on commit fd32d22

Please sign in to comment.