Skip to content

Commit

Permalink
re-add AsyncInterface definition, fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Dec 8, 2017
1 parent 40d47f2 commit 986fb3e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
9 changes: 8 additions & 1 deletion externs/polymer-internal-shared-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,11 @@ let PathInfo;
* parentModel: (boolean | undefined)
* }}
*/
let TemplatizeOptions;
let TemplatizeOptions;

/** @record */
function AsyncInterface(){}
/** @type {function(!Function, number=): number} */
AsyncInterface.prototype.run;
/** @type {function(number)} */
AsyncInterface.prototype.cancel;
4 changes: 2 additions & 2 deletions lib/mixins/property-effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@
}

/**
* Overrides the `PropertyAccessors` implementation to introduce special
* Overrides the `PropertiesChanged` implementation to introduce special
* dirty check logic depending on the property & value being set:
*
* 1. Any value set to a path (e.g. 'obj.prop': 42 or 'obj.prop': {...})
Expand All @@ -1451,12 +1451,12 @@
* user code); we could introduce a "fixup" for temporarily cached array
* paths if needed: https://github.com/Polymer/polymer/issues/4227
*
* @override
* @param {string} property Name of the property
* @param {*} value Value to set
* @param {boolean=} shouldNotify True if property should fire notification
* event (applies only for `notify: true` properties)
* @return {boolean} Returns true if the property changed
* @override
*/
_setPendingProperty(property, value, shouldNotify) {
let isPath = this.__dataHasPaths && Polymer.Path.isPath(property);
Expand Down
6 changes: 3 additions & 3 deletions lib/utils/async.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
*
* @memberof Polymer.Async.timeOut
* @param {number=} delay Time to wait before calling callbacks in ms
* @return {AsyncInterface} An async timeout interface
* @return {!AsyncInterface} An async timeout interface
*/
after(delay) {
return {
run(fn) { return setTimeout(fn, delay); },
run(fn) { return window.setTimeout(fn, delay); },
cancel(handle) {
window.clearTimeout(handle);
}
Expand Down Expand Up @@ -123,7 +123,7 @@
* Cancels a previously enqueued `animationFrame` callback.
*
* @function
* @memberof Polymer.Async.timeOut
* @memberof Polymer.Async.animationFrame
* @param {number} handle Handle returned from `run` of callback to cancel
* @return {void}
*/
Expand Down

0 comments on commit 986fb3e

Please sign in to comment.