Skip to content

Commit

Permalink
Replace _patchMatchesEffect.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste committed Jul 23, 2016
1 parent 0320763 commit 6ad9295
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/standard/notify-path.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../lib/case-map.html">
<link rel="import" href="../lib/path.html">
<script>

/**
Expand Down Expand Up @@ -63,6 +64,8 @@
// Using strict here to ensure fast argument manipulation in array methods
'use strict';

var Path = Polymer.Path;

Polymer.Base._addFeature({
/**
* Notify that a path has changed.
Expand Down Expand Up @@ -303,30 +306,23 @@
},

_complexObserverPathEffect: function(path, value, effect) {
if (this._pathMatchesEffect(path, effect)) {
if (Path.matches(effect.trigger.name, effect.trigger.wildcard, path)) {
Polymer.Bind._complexObserverEffect.call(this, path, value, effect);
}
},

_computePathEffect: function(path, value, effect) {
if (this._pathMatchesEffect(path, effect)) {
if (Path.matches(effect.trigger.name, effect.trigger.wildcard, path)) {
Polymer.Bind._computeEffect.call(this, path, value, effect);
}
},

_annotatedComputationPathEffect: function(path, value, effect) {
if (this._pathMatchesEffect(path, effect)) {
if (Path.matches(effect.trigger.name, effect.trigger.wildcard, path)) {
Polymer.Bind._annotatedComputationEffect.call(this, path, value, effect);
}
},

_pathMatchesEffect: function(path, effect) {
var effectArg = effect.trigger.name;
return (effectArg == path) ||
(effectArg.indexOf(path + '.') === 0) ||
(effect.trigger.wildcard && path.indexOf(effectArg) === 0);
},

/**
* Aliases one data path as another, such that path notifications from one
* are routed to the other.
Expand Down Expand Up @@ -612,7 +608,6 @@
_annotatedComputationPathEffect: Polymer.Base._annotatedComputationPathEffect,
_computePathEffect: Polymer.Base._computePathEffect,
_modelForPath: Polymer.Base._modelForPath,
_pathMatchesEffect: Polymer.Base._pathMatchesEffect,
_notifyBoundPaths: Polymer.Base._notifyBoundPaths,
_getPathParts: Polymer.Base._getPathParts
});
Expand Down

0 comments on commit 6ad9295

Please sign in to comment.