fix: cache value & cancel tween for instant-set (#4847)

pull/4849/head
Pat Cavit 4 years ago committed by GitHub
parent 283f9ae6cf
commit ef2a886c83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -94,7 +94,12 @@ export function tweened<T>(value?: T, defaults: Options<T> = {}): Tweened<T> {
} = assign(assign({}, defaults), opts);
if (duration === 0) {
store.set(target_value);
if (previous_task) {
previous_task.abort();
previous_task = null;
}
store.set(value = target_value);
return Promise.resolve();
}

Loading…
Cancel
Save