Skip to content

Commit

Permalink
Lint and type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Feb 6, 2018
1 parent c1885a6 commit 5607a2d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
9 changes: 9 additions & 0 deletions externs/closure-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/mixins/properties-changed.html
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
* 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;
}

Expand Down
3 changes: 1 addition & 2 deletions test/unit/properties-changed.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@
done();
});
});
})

});
});

</script>
Expand Down
15 changes: 15 additions & 0 deletions types/lib/mixins/properties-changed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5607a2d

Please sign in to comment.