Skip to content

Commit 4b4aba9

Browse files
committed
Fixed bug on Snapshot when emiting mutations in undo or redo
1 parent 36d9cce commit 4b4aba9

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

.npmignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ npm-debug.log*
1818
src/
1919
test/
2020
examples/
21-
test*.*
21+
test*.*
22+
.editorconfig
23+
.travis.yml
24+
Gruntfile.js

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dop",
3-
"version": "0.22.6",
3+
"version": "0.22.7",
44
"main": "./dist/dop.nodejs.js",
55
"browser": "./dist/dop.js",
66
"unpkg": "./dist/dop.min.js",

src/api/collect.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
dop.collect = function(indexFunction) {
3-
dop.util.invariant(arguments.length==0 || (arguments.length==1 && isFunction(indexFunction)), 'dop.collect only accept one argument as function');
4-
var index = indexFunction ? indexFunction(dop.data.collectors) : dop.data.collectors.length;
2+
dop.collect = function(index_function) {
3+
dop.util.invariant(arguments.length==0 || (arguments.length==1 && isFunction(index_function)), 'dop.collect only accept one argument as function');
4+
var index = index_function ? index_function(dop.data.collectors) : dop.data.collectors.length;
55
return dop.core.createCollector(dop.data.collectors, index);
66
};

src/core/constructors/snapshot.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dop.core.snapshot.prototype.undo = function () {
99
if (this.forward && this.mutations.length>0) {
1010
this.forward = false;
1111
this.setPatch(this.getUnpatch());
12-
this.emit();
1312
}
1413
};
1514

@@ -18,7 +17,6 @@ dop.core.snapshot.prototype.redo = function () {
1817
if (!this.forward && this.mutations.length>0) {
1918
this.forward = true;
2019
this.setPatch(this.getPatch());
21-
this.emit();
2220
}
2321
};
2422

0 commit comments

Comments
 (0)