UNPKG
animate-value
Version:
latest (1.1.0)
1.1.0
1.0.1
1.0.0
🏃 animates a numeric value
github.com/duivvv/animate-value
duivvv/animate-value
animate-value
/
src
/
lib
/
calc
/
calcProgress.js
11 lines
(6 loc)
•
208 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
// @flow
import
ease
from
'../ease/'
;
export
default
(
start
:
number
,
duration
:
number
,
easing
:
string
):
number
=>
{
const
prog
:
number
= (
Date
.
now
() - start) / duration;
return
ease[easing](prog); };