Update site/content/docs/03-run-time.md

Co-authored-by: Ignatius Bagus <ignatius.mbs@gmail.com>
pull/7463/head
Tan Li Hau 4 years ago committed by GitHub
parent f350e6a636
commit df15f9c029
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -578,7 +578,12 @@ const coords = spring({ x: 50, y: 50 });
// updates the value immediately // updates the value immediately
coords.set({ x: 100, y: 200 }, { hard: true }); coords.set({ x: 100, y: 200 }, { hard: true });
// preserves existing momentum for 1s // preserves existing momentum for 1s
coords.update((target_coords, coords) => { return { x: target_coords.x, y: coords.y }; }, { soft: 1 }); coords.update(
(target_coords, coords) => {
return { x: target_coords.x, y: coords.y };
},
{ soft: 1 }
);
``` ```
[See a full example on the spring tutorial.](/tutorial/spring) [See a full example on the spring tutorial.](/tutorial/spring)

Loading…
Cancel
Save