Skip to content

Commit

Permalink
Fix defaulting to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgilbertson committed Nov 9, 2019
1 parent 2c738b2 commit 62f5438
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
var raf = typeof window !== 'undefined' && 'requestAnimationFrame' in window
? window.requestAnimationFrame
: function(func) {
setTimeout(func, 16)
};

function ease(options) {
var startValue = options.startValue || 0;
var endValue = options.endValue || 1;
var durationMs = options.durationMs || 200;
var startValue = 'startValue' in options ? options.startValue : 0;
var endValue = 'endValue' in options ? options.endValue : 1;
var durationMs = 'durationMs' in options ? options.durationMs : 200;
var onComplete = options.onComplete || function() {};

var raf = window.requestAnimationFrame || function(func) {
window.setTimeout(func, 16)
};
var stepCount = durationMs / 16;
var valueIncrement = (endValue - startValue) / stepCount;
var sinValueIncrement = Math.PI / stepCount;
Expand Down

1 comment on commit 62f5438

@iamsoftycc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

groups_48dp

Please sign in to comment.