@@ -2,28 +2,28 @@ import React, { createElement, cloneElement } from 'react';
2
2
import { findDOMNode } from 'react-dom' ;
3
3
4
4
const _ease = {
5
- easeInElastic : function ( _p , o , t ) {
5
+ easeInElastic : ( _p , o , t ) => {
6
6
let p = _p ;
7
7
const _p1 = o >= 1 ? o : 1 ;
8
8
const _p2 = ( t || 1 ) / ( o < 1 ? o : 1 ) ;
9
9
const _p3 = _p2 / Math . PI * 2 * ( Math . asin ( 1 / _p1 ) || 0 ) ;
10
10
return - ( _p1 * Math . pow ( 2 , 10 * ( p -= 1 ) ) * Math . sin ( ( p - _p3 ) * _p2 ) ) ;
11
11
} ,
12
- easeOutElastic : function ( p , o , t ) {
12
+ easeOutElastic : ( p , o , t ) => {
13
13
const _p1 = o >= 1 ? o : 1 ;
14
14
const _p2 = ( t || 1 ) / ( o < 1 ? o : 1 ) ;
15
15
const _p3 = _p2 / Math . PI * 2 * ( Math . asin ( 1 / _p1 ) || 0 ) ;
16
16
return _p1 * Math . pow ( 2 , - 10 * p ) * Math . sin ( ( p - _p3 ) * _p2 ) + 1 ;
17
17
} ,
18
- easeInOutElastic : function ( _p , o , t ) {
18
+ easeInOutElastic : ( _p , o , t ) => {
19
19
let p = _p ;
20
20
const _p1 = o >= 1 ? o : 1 ;
21
21
const _p2 = ( t || 1 ) / ( o < 1 ? o : 1 ) ;
22
22
const _p3 = _p2 / Math . PI * 2 * ( Math . asin ( 1 / _p1 ) || 0 ) ;
23
23
p *= 2 ;
24
24
return p < 1 ? - 0.5 * ( _p1 * Math . pow ( 2 , 10 * ( p -= 1 ) ) * Math . sin ( ( p - _p3 ) * _p2 ) ) : _p1 * Math . pow ( 2 , - 10 * ( p -= 1 ) ) * Math . sin ( ( p - _p3 ) * _p2 ) * 0.5 + 1 ;
25
25
} ,
26
- easeInBounce : function ( _p ) {
26
+ easeInBounce : ( _p ) => {
27
27
let p = _p ;
28
28
const __p = 1 - p ;
29
29
if ( __p < 1 / 2.75 ) {
@@ -35,7 +35,7 @@ const _ease = {
35
35
}
36
36
return 1 - ( 7.5625 * ( p -= 2.625 / 2.75 ) * p + 0.984375 ) ;
37
37
} ,
38
- easeOutBounce : function ( _p ) {
38
+ easeOutBounce : ( _p ) => {
39
39
let p = _p ;
40
40
if ( p < 1 / 2.75 ) {
41
41
return 7.5625 * p * p ;
@@ -46,7 +46,7 @@ const _ease = {
46
46
}
47
47
return 7.5625 * ( p -= 2.625 / 2.75 ) * p + 0.984375 ;
48
48
} ,
49
- easeInOutBounce : function ( _p ) {
49
+ easeInOutBounce : ( _p ) => {
50
50
let p = _p ;
51
51
const invert = ( p < 0.5 ) ;
52
52
if ( invert ) {
@@ -82,9 +82,9 @@ if (typeof document !== 'undefined' && typeof window !== 'undefined') {
82
82
const callback = arguments [ arguments . length - 1 ] ;
83
83
// call after stack flushes
84
84
// in case you app depends on the asyncron nature of this function
85
- setImmediate ( function ( ) {
86
- callback ( ) ;
87
- } ) ;
85
+ setImmediate ( ( ) =>
86
+ callback ( )
87
+ ) ;
88
88
} ;
89
89
}
90
90
@@ -193,16 +193,12 @@ class QueueAnim extends React.Component {
193
193
}
194
194
195
195
componentWillUnmount ( ) {
196
- if ( this . originalChildren && this . originalChildren . length > 0 ) {
197
- this . originalChildren . forEach ( child => {
198
- if ( child && this . refs [ child . key ] ) {
199
- velocity ( findDOMNode ( this . refs [ child . key ] ) , 'stop' ) ;
200
- }
201
- } ) ;
202
- Object . keys ( this . placeholderTimeoutIds ) . forEach ( key => {
203
- clearTimeout ( this . placeholderTimeoutIds [ key ] ) ;
204
- } ) ;
205
- }
196
+ [ ] . concat ( this . keysToEnter , this . keysToLeave , this . keysAnimating ) . forEach ( key =>
197
+ velocity ( findDOMNode ( this . refs [ key ] ) , 'stop' )
198
+ ) ;
199
+ Object . keys ( this . placeholderTimeoutIds ) . forEach ( key => {
200
+ clearTimeout ( this . placeholderTimeoutIds [ key ] ) ;
201
+ } ) ;
206
202
}
207
203
208
204
getVelocityConfig ( index , ...args ) {
0 commit comments