Lint and type fixes

This commit is contained in:
Steven Orvell
2018-02-06 14:48:36 -08:00
parent c1885a6a94
commit 5607a2d8c3
4 changed files with 26 additions and 3 deletions

View File

@@ -78,6 +78,15 @@ Polymer_PropertiesChanged.prototype._enableProperties = function(){};
Polymer_PropertiesChanged.prototype._flushProperties = function(){};
/**
* @param {!Object} currentProps Bag of all current accessor values
* @param {!Object} changedProps Bag of properties changed since the last
call to `_propertiesChanged`
* @param {!Object} oldProps Bag of previous values for each property
in `changedProps`
* @return {boolean}
*/
Polymer_PropertiesChanged.prototype._shouldPropertiesChange = function(currentProps, changedProps, oldProps){};
/**
* @param {!Object} currentProps Bag of all current accessor values
* @param {!Object} changedProps Bag of properties changed since the last
call to `_propertiesChanged`
* @param {!Object} oldProps Bag of previous values for each property

View File

@@ -353,7 +353,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* in `changedProps`
* @return {boolean} true if changedProps is truthy
*/
_shouldPropertiesChange(props, changedProps, old) {
_shouldPropertiesChange(currentProps, changedProps, oldProps) { // eslint-disable-line no-unused-vars
return changedProps;
}

View File

@@ -160,8 +160,7 @@ suite('properties-changed', function() {
done();
});
});
})
});
});
</script>

View File

@@ -182,6 +182,21 @@ declare namespace Polymer {
*/
_flushProperties(): void;
/**
* Called in `_flushProperties` to determine if `_propertiesChanged`
* should be called. The default implementation returns true if
* properties are pending. Override to customize when
* `_propertiesChanged` is called.
*
* @param currentProps Bag of all current accessor values
* @param changedProps Bag of properties changed since the last
* call to `_propertiesChanged`
* @param oldProps Bag of previous values for each property
* in `changedProps`
* @returns true if changedProps is truthy
*/
_shouldPropertiesChange(currentProps: object, changedProps: object, oldProps: object): boolean;
/**
* Callback called when any properties with accessors created via
* `_createPropertyAccessor` have been set.