proxy-state-tree
Advanced tools
Comparing version 1.0.0-alpha2 to 1.0.0-alpha3
@@ -124,6 +124,11 @@ 'use strict'; | ||
} | ||
trackMutations(cb) { | ||
startMutationTracking() { | ||
const currentMutations = this.mutations.slice(); | ||
this.isTrackingMutations = true; | ||
this.mutations.length = 0; | ||
cb(); | ||
return currentMutations; | ||
} | ||
stopMutationTracking() { | ||
for (let callback in this.mutationCallbacks) { | ||
@@ -141,9 +146,16 @@ this.mutationCallbacks[callback](this.mutations); | ||
this.isTrackingMutations = false; | ||
return this.mutations; | ||
} | ||
trackPaths(cb) { | ||
startPathsTracking() { | ||
const currentPaths = this.paths.slice(); | ||
this.isTrackingPaths = true; | ||
this.paths.length = 0; | ||
cb(); | ||
return currentPaths; | ||
} | ||
stopPathsTracking() { | ||
this.isTrackingPaths = false; | ||
return this.paths; | ||
@@ -150,0 +162,0 @@ } |
@@ -122,6 +122,11 @@ const isPlainObject = require("is-plain-object"); | ||
} | ||
trackMutations(cb) { | ||
startMutationTracking() { | ||
const currentMutations = this.mutations.slice(); | ||
this.isTrackingMutations = true; | ||
this.mutations.length = 0; | ||
cb(); | ||
return currentMutations; | ||
} | ||
stopMutationTracking() { | ||
for (let callback in this.mutationCallbacks) { | ||
@@ -139,9 +144,16 @@ this.mutationCallbacks[callback](this.mutations); | ||
this.isTrackingMutations = false; | ||
return this.mutations; | ||
} | ||
trackPaths(cb) { | ||
startPathsTracking() { | ||
const currentPaths = this.paths.slice(); | ||
this.isTrackingPaths = true; | ||
this.paths.length = 0; | ||
cb(); | ||
return currentPaths; | ||
} | ||
stopPathsTracking() { | ||
this.isTrackingPaths = false; | ||
return this.paths; | ||
@@ -148,0 +160,0 @@ } |
{ | ||
"name": "proxy-state-tree", | ||
"version": "1.0.0-alpha2", | ||
"version": "1.0.0-alpha3", | ||
"description": "An implementation of the Mobx/Vue state tracking approach, for library authors", | ||
@@ -5,0 +5,0 @@ "main": "dist/proxy-state-tree.cjs.js", |
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
18399
345