Skip to content

Commit

Permalink
document new spring options
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed May 4, 2019
1 parent 26d736f commit 4ef1a2d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions site/content/docs/03-run-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ A `spring` store gradually changes to its target value based on its `stiffness`

As with [`tweened`](#tweened) stores, `set` and `update` return a Promise that resolves if the spring settles. The `store.stiffness` and `store.damping` properties can be changed while the spring is in motion, and will take immediate effect.

Both `set` and `update` can take a second argument — an object with `hard` or `soft` properties. `{ hard: true }` sets the target value immediately; `{ soft: n }` preserves existing momentum for `n` seconds before settling. `{ soft: true }` is equivalent to `{ soft: 0.5 }`.

[See a full example on the spring tutorial.](tutorial/spring)

```html
Expand Down

0 comments on commit 4ef1a2d

Please sign in to comment.