Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moving lines around solved the problem of 'ready' never being caught

  • Loading branch information...
commit c8d5652233ca1539a1b19e0dcf65dec5bf8812f5 1 parent 0404a1a
@pkrumins authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 lib/store.js
View
15 lib/store.js
@@ -33,13 +33,6 @@ function Store(opts, cb) {
var actionQueue = [];
var ready = false;
- self.on('ready', function () {
- ready = true;
- actionQueue.forEach(function (action) {
- action.action.apply(self, action.args);
- });
- delete actionQueue;
- });
function queue(action, args) {
actionQueue.push({ action : action, args : [].slice.call(args) });
@@ -228,6 +221,14 @@ function Store(opts, cb) {
;
};
+ self.on('ready', function () {
+ ready = true;
+ actionQueue.forEach(function (action) {
+ action.action.apply(self, action.args);
+ });
+ delete actionQueue;
+ });
+
if (openDbs[opts.filename]) {
var db = openDbs[opts.filename];
cb(undefined, db);
Please sign in to comment.
Something went wrong with that request. Please try again.