Skip to content
This repository has been archived by the owner on May 19, 2019. It is now read-only.

Commit

Permalink
0.6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
c58 committed Mar 10, 2016
1 parent 914eb59 commit b953eb7
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 20 deletions.
24 changes: 15 additions & 9 deletions build/marsdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,19 +427,22 @@ var _defaultIdGenerator = _ShortIdGenerator2.default;
// the second execution cycle
var _startedUp = false;
var _startUpQueue = [];
var _startUpTimeout = 0;
var _startUpId = 0;

// Internals
function _resetStartup() {
clearTimeout(_startUpTimeout);
_startUpId += 1;
_startUpQueue = [];
_startedUp = false;
_startUpTimeout = setTimeout(function () {
_startedUp = true;
(0, _forEach2.default)(_startUpQueue, function (fn) {
return fn();
});
_startUpQueue = [];
var currStartId = _startUpId;
setTimeout(function () {
if (currStartId === _startUpId) {
_startedUp = true;
(0, _forEach2.default)(_startUpQueue, function (fn) {
return fn();
});
_startUpQueue = [];
}
}, 0);
}

Expand Down Expand Up @@ -1763,7 +1766,6 @@ var CursorObservable = function (_Cursor) {
var insertedInResult = updatedInResult || newDoc && !oldDoc && this._matcher.documentMatches(newDoc).result;

if (insertedInResult) {
this.emit('cursorChanged');
return this.update();
}
}
Expand Down Expand Up @@ -1812,6 +1814,10 @@ var CursorObservable = function (_Cursor) {

var firstRun = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];

if (!firstRun) {
this.emit('cursorChanged');
}

return this.exec().then(function (result) {
_this3._updateLatestIds();
return _this3._propagateUpdate(firstRun).then(function () {
Expand Down
2 changes: 1 addition & 1 deletion build/marsdb.min.js

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions dist/Collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,22 @@ var _defaultIdGenerator = _ShortIdGenerator2.default;
// the second execution cycle
var _startedUp = false;
var _startUpQueue = [];
var _startUpTimeout = 0;
var _startUpId = 0;

// Internals
function _resetStartup() {
clearTimeout(_startUpTimeout);
_startUpId += 1;
_startUpQueue = [];
_startedUp = false;
_startUpTimeout = setTimeout(function () {
_startedUp = true;
(0, _forEach2.default)(_startUpQueue, function (fn) {
return fn();
});
_startUpQueue = [];
var currStartId = _startUpId;
setTimeout(function () {
if (currStartId === _startUpId) {
_startedUp = true;
(0, _forEach2.default)(_startUpQueue, function (fn) {
return fn();
});
_startUpQueue = [];
}
}, 0);
}

Expand Down
5 changes: 4 additions & 1 deletion dist/CursorObservable.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ var CursorObservable = function (_Cursor) {
var insertedInResult = updatedInResult || newDoc && !oldDoc && this._matcher.documentMatches(newDoc).result;

if (insertedInResult) {
this.emit('cursorChanged');
return this.update();
}
}
Expand Down Expand Up @@ -307,6 +306,10 @@ var CursorObservable = function (_Cursor) {

var firstRun = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];

if (!firstRun) {
this.emit('cursorChanged');
}

return this.exec().then(function (result) {
_this3._updateLatestIds();
return _this3._propagateUpdate(firstRun).then(function () {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "marsdb",
"version": "0.6.5",
"version": "0.6.6",
"author": {
"name": "Artem Artemev",
"email": "art@studytime.me"
Expand Down

0 comments on commit b953eb7

Please sign in to comment.