MCPcopy Create free account
hub / github.com/ptmt/react-native-macos / inOut

Method inOut

Libraries/Animated/src/Easing.js:255–264  ·  view source on GitHub ↗

* Makes any easing function symmetrical. The easing function will run * forwards for half of the duration, then backwards for the rest of the * duration.

(
    easing: (t: number) => number,
  )

Source from the content-addressed store, hash-verified

253 * duration.
254 */
255 static inOut(
256 easing: (t: number) => number,
257 ): (t: number) => number {
258 return (t) => {
259 if (t < 0.5) {
260 return easing(t * 2) / 2;
261 }
262 return 1 - easing((1 - t) * 2) / 2;
263 };
264 }
265}
266
267module.exports = Easing;

Callers 4

AnimatedExample.jsFile · 0.80
easeInOutFunction · 0.80
Easing-test.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected