Skip to content

Commit

Permalink
fix: state set improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickheng committed Feb 13, 2017
1 parent 034424d commit 9e95a42
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@ class State {
target = target[p]

// Dispatch signal on change
let signalId = containerId
for (let j = 0; j < i; j++) {
signalId += `_${splittedQuery[i]}`

console.log(signalId)
if (typeof container.signals[signalId] !== 'undefined') {
if (!isEquals(oldVal, target)) {
container.signals[signalId].dispatch(oldVal, target)
}
let signalId = containerId
for (let j = 1; j <= i; j++) {
signalId += `_${splittedQuery[j]}`
}
if (typeof container.signals[signalId] !== 'undefined') {
if (!isEquals(oldVal, target)) {
container.signals[signalId].dispatch(oldVal, target)
}
}
}
Expand Down

0 comments on commit 9e95a42

Please sign in to comment.