Zack ae0ad1fc7e Implement modulo operator method
Summary:This is an initial take on how to allow for value wrapping in Animated (currently `.timing` only). It adds a wrap config options which is an array specifying a range of values to be wrapped around. Anytime the delta of `toValue and fromValue > wrapDistance / 2` instead of animating the long way it will animate towards the range extremity and then after breaching the range it will readjust to animated to the true toValue.

Example Usage:
```js
Animated.timing(
  this.state.animatedDegrees,
  {toValue: Math.random()*360, wrap: [0, 360]}
).start()
```

This is presumably very valuable in rotation based animations, but could also be useful in other applications like wrapping the edges of the viewport.

Questions & Todo:
- Is `wrap` as a config key semantically meaningful and accurate?
- Is there a way to expose this as a config option on `.interpolate` rather than timing
- Generalize to all animated API's (spring, decay), and will this work with ValueXY out of the box?
- Add tests
Closes https://github.com/facebook/react-native/pull/5743

Differential Revision: D2979992

fb-gh-sync-id: 69be510feba8c43acb10c253036f5854adff9258
shipit-source-id: 69be510feba8c43acb10c253036f5854adff9258
2016-02-25 17:19:31 -08:00
..
2015-07-24 08:41:58 -08:00
2016-02-25 17:19:31 -08:00
2016-01-30 17:11:28 -08:00
2016-01-08 15:42:32 -08:00
2016-02-10 08:40:39 -08:00
2016-02-11 02:45:34 -08:00
2016-02-12 12:58:31 -08:00
2016-02-05 16:45:46 -08:00
2015-07-24 08:41:58 -08:00
2016-02-17 07:38:33 -08:00
2016-02-11 02:45:34 -08:00