Skip to content

Commit

Permalink
fix(🐛): remove non supported spread operator (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon authored Apr 30, 2022
1 parent 47dc500 commit 61c1265
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/Transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,19 @@ export const transformOrigin = (
transformations: RNTransform
): RNTransform => {
"worklet";
return [
{ translateX: x },
{ translateY: y },
...transformations,
{ translateX: -x },
{ translateY: -y },
];
return ([{ translateX: x }, { translateY: y }] as RNTransform)
.concat(transformations)
.concat([{ translateX: -x }, { translateY: -y }]);
};

export const transformOrigin2d = (
{ x, y }: Vector,
transformations: Transforms2d
): Transforms2d => {
"worklet";
return [
{ translateX: x },
{ translateY: y },
...transformations,
{ translateX: -x },
{ translateY: -y },
];
return ([{ translateX: x }, { translateY: y }] as Transforms2d)
.concat(transformations)
.concat([{ translateX: -x }, { translateY: -y }]);
};

export const useTranslation = ({
Expand Down

0 comments on commit 61c1265

Please sign in to comment.