Skip to content

Commit

Permalink
fix: cache value & cancel tween for instant-set (#4847)
Browse files Browse the repository at this point in the history
  • Loading branch information
tivac committed May 17, 2020
1 parent 283f9ae commit ef2a886
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/runtime/motion/tweened.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit ef2a886

Please sign in to comment.