proxy-state-tree
Advanced tools
Comparing version 1.0.0-1532691371168 to 1.0.0-1532810720851
@@ -32,2 +32,3 @@ import proxify, { IS_PROXY, STATUS } from './proxify'; | ||
flush() { | ||
const paths = new Set(); | ||
const pathCallbacksToCall = new Set(); | ||
@@ -38,9 +39,11 @@ const mutations = this.mutations.slice(); | ||
if (this.pathDependencies[objectChange]) { | ||
for (let callback of this.pathDependencies[objectChange]) { | ||
pathCallbacksToCall.add(callback); | ||
} | ||
paths.add(objectChange); | ||
} | ||
} | ||
for (let mutation in this.mutations) { | ||
const path = this.mutations[mutation].path; | ||
paths.add(this.mutations[mutation].path); | ||
} | ||
// Sort so that parent paths are called first | ||
const sortedPaths = Array.from(paths).sort(); | ||
for (let path of sortedPaths) { | ||
if (this.pathDependencies[path]) { | ||
@@ -55,2 +58,3 @@ for (let callback of this.pathDependencies[path]) { | ||
} | ||
paths.clear(); | ||
pathCallbacksToCall.clear(); | ||
@@ -57,0 +61,0 @@ this.mutations.length = 0; |
@@ -35,2 +35,3 @@ "use strict"; | ||
flush() { | ||
const paths = new Set(); | ||
const pathCallbacksToCall = new Set(); | ||
@@ -41,9 +42,11 @@ const mutations = this.mutations.slice(); | ||
if (this.pathDependencies[objectChange]) { | ||
for (let callback of this.pathDependencies[objectChange]) { | ||
pathCallbacksToCall.add(callback); | ||
} | ||
paths.add(objectChange); | ||
} | ||
} | ||
for (let mutation in this.mutations) { | ||
const path = this.mutations[mutation].path; | ||
paths.add(this.mutations[mutation].path); | ||
} | ||
// Sort so that parent paths are called first | ||
const sortedPaths = Array.from(paths).sort(); | ||
for (let path of sortedPaths) { | ||
if (this.pathDependencies[path]) { | ||
@@ -58,2 +61,3 @@ for (let callback of this.pathDependencies[path]) { | ||
} | ||
paths.clear(); | ||
pathCallbacksToCall.clear(); | ||
@@ -60,0 +64,0 @@ this.mutations.length = 0; |
{ | ||
"name": "proxy-state-tree", | ||
"version": "1.0.0-1532691371168", | ||
"version": "1.0.0-1532810720851", | ||
"description": "An implementation of the Mobx/Vue state tracking approach, for library authors", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
216123
2174