Comparing version 1.0.0-1532018253864 to 1.0.0-1532031987960
@@ -7,5 +7,6 @@ class Derived { | ||
this.cb = cb; | ||
this.updateCount = 0; | ||
return this.evaluate.bind(this); | ||
} | ||
evaluate(proxyStateTree) { | ||
evaluate(actionChain, proxyStateTree, path) { | ||
if (this.isDirty) { | ||
@@ -24,2 +25,9 @@ const trackId = proxyStateTree.startPathsTracking(); | ||
} | ||
actionChain.emit('derived', { | ||
path, | ||
paths: Array.from(this.paths), | ||
updateCount: this.updateCount, | ||
value: this.value, | ||
}); | ||
this.updateCount++; | ||
} | ||
@@ -26,0 +34,0 @@ // Tracks the paths for the consumer of this derived value |
@@ -9,3 +9,5 @@ import { actionChainFactory } from 'action-chain'; | ||
constructor(configuration, options = {}) { | ||
const proxyStateTree = new ProxyStateTree(configuration.state || {}); | ||
const proxyStateTree = new ProxyStateTree(configuration.state || {}, { | ||
dynamicWrapper: (proxyStateTree, path, func) => func(actionChain, proxyStateTree, path), | ||
}); | ||
const actionChain = actionChainFactory(Object.assign({ | ||
@@ -85,2 +87,6 @@ state: proxyStateTree.get(), | ||
})); | ||
actionChain.on('derived', (data) => devtools.send({ | ||
type: 'derived', | ||
data, | ||
})); | ||
this.devtools = devtools; | ||
@@ -87,0 +93,0 @@ } |
@@ -9,5 +9,6 @@ "use strict"; | ||
this.cb = cb; | ||
this.updateCount = 0; | ||
return this.evaluate.bind(this); | ||
} | ||
evaluate(proxyStateTree) { | ||
evaluate(actionChain, proxyStateTree, path) { | ||
if (this.isDirty) { | ||
@@ -26,2 +27,9 @@ const trackId = proxyStateTree.startPathsTracking(); | ||
} | ||
actionChain.emit('derived', { | ||
path, | ||
paths: Array.from(this.paths), | ||
updateCount: this.updateCount, | ||
value: this.value, | ||
}); | ||
this.updateCount++; | ||
} | ||
@@ -28,0 +36,0 @@ // Tracks the paths for the consumer of this derived value |
@@ -13,3 +13,5 @@ "use strict"; | ||
constructor(configuration, options = {}) { | ||
const proxyStateTree = new proxy_state_tree_1.default(configuration.state || {}); | ||
const proxyStateTree = new proxy_state_tree_1.default(configuration.state || {}, { | ||
dynamicWrapper: (proxyStateTree, path, func) => func(actionChain, proxyStateTree, path), | ||
}); | ||
const actionChain = action_chain_1.actionChainFactory(Object.assign({ | ||
@@ -89,2 +91,6 @@ state: proxyStateTree.get(), | ||
})); | ||
actionChain.on('derived', (data) => devtools.send({ | ||
type: 'derived', | ||
data, | ||
})); | ||
this.devtools = devtools; | ||
@@ -91,0 +97,0 @@ } |
{ | ||
"name": "overmind", | ||
"version": "1.0.0-1532018253864", | ||
"version": "1.0.0-1532031987960", | ||
"description": "Functional actions", | ||
@@ -36,5 +36,5 @@ "author": "Christian Alfoni <christianalfoni@gmail.com>", | ||
"@types/node": "^10.5.1", | ||
"action-chain": "1.0.0-1532018253864", | ||
"action-chain": "1.0.0-1532031987960", | ||
"is-plain-object": "^2.0.4", | ||
"proxy-state-tree": "1.0.0-1532018253864", | ||
"proxy-state-tree": "1.0.0-1532031987960", | ||
"tslib": "^1.9.3" | ||
@@ -41,0 +41,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
200974
1772
+ Addedaction-chain@1.0.0-1532031987960(transitive)
+ Addedproxy-state-tree@1.0.0-1532031987960(transitive)
- Removedaction-chain@1.0.0-1532018253864(transitive)
- Removedproxy-state-tree@1.0.0-1532018253864(transitive)