Skip to content

Commit

Permalink
Document Promise as an external
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Oct 10, 2017
1 parent cb94446 commit 3c8ecdb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export { Tweenable, tween } from './tweenable';
export { interpolate } from './interpolate';
export { setBezierFunction, unsetBezierFunction } from './bezier';

/**
* @external Promise
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise}
*/

/**
* @callback {Function} shifty.easingFunction
* @param {number} position The normalized (0-1) position of the tween.
Expand Down
10 changes: 4 additions & 6 deletions src/tweenable.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ const noop = () => {};
* @param {Function(string)} fn
* @private
*/
export const each = (obj, fn) => {
Object.keys(obj).forEach(fn);
};
export const each = (obj, fn) => Object.keys(obj).forEach(fn);

/**
* @param {Object} obj
Expand Down Expand Up @@ -236,7 +234,7 @@ export class Tweenable {
* @method shifty.Tweenable#tween
* @param {shifty.tweenConfig} [config] Gets passed to {@link
* shifty.Tweenable#setConfig}
* @return {Promise}
* @return {external:Promise}
*/
tween (config = undefined) {
if (this._isTweening) {
Expand Down Expand Up @@ -342,7 +340,7 @@ export class Tweenable {
/**
* Resume a paused tween.
* @method shifty.Tweenable#resume
* @return {Promise}
* @return {external:Promise}
*/
resume () {
if (this._isPaused) {
Expand Down Expand Up @@ -493,7 +491,7 @@ assign(Tweenable, {
* () => console.log('All done!')
* );
*
* @returns {Promise}
* @returns {external:Promise}
*/
export function tween (config = {}) {
const tweenable = new Tweenable();
Expand Down

0 comments on commit 3c8ecdb

Please sign in to comment.