Skip to content

Commit

Permalink
Add Animated.divide
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Stanberry committed Aug 16, 2018
1 parent 8ac0d7f commit ecc90f4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/api/Animated/AnimatedImplementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,32 @@ class AnimatedMultiplication extends AnimatedWithChildren {
}
}

class AnimatedDivison extends AnimatedWithChildren {
constructor(a, b) {
super();
this._a = a;
this._b = b;
}

__getValue() {
return this._a.__getValue() / this._b.__getValue();
}

interpolate(config) {
return new AnimatedInterpolation(this, Interpolation.create(config));
}

__attach() {
this._a.__addChild(this);
this._b.__addChild(this);
}

__detach() {
this._a.__removeChild(this);
this._b.__removeChild(this);
}
}

class AnimatedTransform extends AnimatedWithChildren {
constructor(transforms) {
super();
Expand Down Expand Up @@ -1187,6 +1213,7 @@ const AnimatedImplementation = {
spring,
add,
multiply,
divide,
sequence,
parallel,
stagger,
Expand Down

0 comments on commit ecc90f4

Please sign in to comment.