[RN] Use default param for elastic bounciness

This commit is contained in:
Spencer Ahrens 2015-09-01 20:33:25 -07:00
Родитель b17b328aed
Коммит 4379aa00de
1 изменённых файлов: 1 добавлений и 4 удалений

Просмотреть файл

@ -69,10 +69,7 @@ class Easing {
* http://tiny.cc/elastic_b_1 (default bounciness = 1)
* http://tiny.cc/elastic_b_3 (bounciness = 3)
*/
static elastic(bounciness: number): (t: number) => number {
if (arguments.length === 0) {
bounciness = 1;
}
static elastic(bounciness: number = 1): (t: number) => number {
var p = bounciness * Math.PI;
return (t) => 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p);
};