You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
474 B
12 lines
474 B
1 year ago
|
import {Interpolation, InterpolatorArgs, Globals} from "@react-spring/web";
|
||
|
import {getAnimated} from "@react-spring/animated";
|
||
|
|
||
|
export class FixedInterpolation<Input = any, Output = any> extends Interpolation<Input, Output> {
|
||
|
constructor(readonly source: unknown, args: InterpolatorArgs<Input, Output>) {
|
||
|
super(source, args);
|
||
|
getAnimated(this)!.setValue(this._get())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Globals.assign({to: (source, args) => new FixedInterpolation(source, args)})
|