Skip to content

Commit ecc90f4

Browse files
author
Andy Stanberry
committed
Add Animated.divide
1 parent 8ac0d7f commit ecc90f4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/api/Animated/AnimatedImplementation.js

+27
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,32 @@ class AnimatedMultiplication extends AnimatedWithChildren {
736736
}
737737
}
738738

739+
class AnimatedDivison extends AnimatedWithChildren {
740+
constructor(a, b) {
741+
super();
742+
this._a = a;
743+
this._b = b;
744+
}
745+
746+
__getValue() {
747+
return this._a.__getValue() / this._b.__getValue();
748+
}
749+
750+
interpolate(config) {
751+
return new AnimatedInterpolation(this, Interpolation.create(config));
752+
}
753+
754+
__attach() {
755+
this._a.__addChild(this);
756+
this._b.__addChild(this);
757+
}
758+
759+
__detach() {
760+
this._a.__removeChild(this);
761+
this._b.__removeChild(this);
762+
}
763+
}
764+
739765
class AnimatedTransform extends AnimatedWithChildren {
740766
constructor(transforms) {
741767
super();
@@ -1187,6 +1213,7 @@ const AnimatedImplementation = {
11871213
spring,
11881214
add,
11891215
multiply,
1216+
divide,
11901217
sequence,
11911218
parallel,
11921219
stagger,

0 commit comments

Comments
 (0)