Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 6c38a95

Browse files
committed
Remove getParameterString
1 parent 0e65f0d commit 6c38a95

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/transit.ts

+5-10
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ class TransitionConfig {
2424
this.value = value;
2525
this.params = params;
2626
}
27-
28-
public getParameterString(extraDelay: number): string {
29-
const {duration, timing, delay} = this.params;
30-
return `${duration}ms ${timing} ${delay + extraDelay}ms`;
31-
}
3227
}
3328

3429
export function transit(value: any, duration: number, timing?: string, delay?: number): any {
@@ -43,12 +38,12 @@ export function resolveTransit(style: CSSProperties, extraDelay = 0): CSSPropert
4338
let transition = "";
4439
let processedStyle = { ...style };
4540
for (const property in style) {
46-
const value = style[property];
47-
if (typeof value === "object") {
48-
const config = value as TransitionConfig;
41+
const val = style[property];
42+
if (typeof val === "object") {
43+
const {value, params: {duration, timing, delay}} = val as TransitionConfig;
4944
if (transition !== "") { transition += ", "; }
50-
transition += `${convertToCSSPrefix(property)} ${config.getParameterString(extraDelay)}`;
51-
processedStyle[property] = config.value;
45+
transition += `${convertToCSSPrefix(property)} ${duration}ms ${timing} ${delay + extraDelay}ms`;
46+
processedStyle[property] = value;
5247
}
5348
}
5449
if (transition) {

0 commit comments

Comments
 (0)