()
| 23 | cancelAnimationFrame(this.rid) |
| 24 | let { COUNT } = this.props |
| 25 | let counting = () => { |
| 26 | let { count } = this.props |
| 27 | switch (true) { |
| 28 | case count > num: |
| 29 | COUNT('DECREMENT') |
| 30 | break |
| 31 | case count < num: |
| 32 | COUNT('INCREMENT') |
| 33 | break |
| 34 | case count === num: |
| 35 | return callback && callback() |
| 36 | } |
| 37 | this.rid = requestAnimationFrame(counting) |
| 38 | } |
| 39 | counting() |
| 40 | }, |
| 41 | componentWillUpdate() { |