Skip to content

Commit

Permalink
Simplify conditional expression.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste committed Feb 19, 2016
1 parent dc180fb commit 970d576
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib/bind/effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@
}
if (arg.wildcard) {
// Only send the actual path changed info if the change that
// caused the observer to run matched the wildcard
var baseChanged = (name.indexOf(path + '.') === 0);
var matches = (effect.trigger.name.indexOf(name) === 0 && !baseChanged);
// caused the observer to run matches this arg. Note that this holds
// also true when `path === name`. We can skip this check b/c then
// `name` and `v` already have the values we want.
// Read the following as: `head(path) === name`.
var matches = path.indexOf(name + '.') === 0;
values[i] = {
path: matches ? path : name,
value: matches ? value : v,
Expand Down

0 comments on commit 970d576

Please sign in to comment.