Skip to content

Commit a3d14dd

Browse files
authored
Fix documentation of Spring [addresses #725 ] (#798)
2 parents e8461ce + b4e8f7c commit a3d14dd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/spring/src/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export type SpringSetter<T> = (
6262
* Creates a signal and a setter that uses spring physics when interpolating from
6363
* one value to another. This means when the value changes, instead of
6464
* transitioning at a steady rate, it "bounces" like a spring would,
65-
* depending on the physics paramters provided. This adds a level of realism to
65+
* depending on the physics parameters provided. This adds a level of realism to
6666
* the transitions and can enhance the user experience.
6767
*
6868
* `T` - The type of the signal. It works for the basic data types that can be
@@ -71,6 +71,7 @@ export type SpringSetter<T> = (
7171
* @param initialValue The initial value of the signal.
7272
* @param options Options to configure the physics of the spring.
7373
* @returns Returns the spring value and a setter.
74+
* The setter optionally accepts options object of type `{ ?hard: boolean; soft?: boolean | number }`
7475
*
7576
* @example
7677
* const [progress, setProgress] = createSpring(0, { stiffness: 0.15, damping: 0.8 });
@@ -195,17 +196,17 @@ export function createSpring<T extends SpringTarget>(
195196
// ===========================================================================
196197

197198
/**
198-
* Creates a spring value that interpolates based on changes on a passed signal.
199+
* Creates a spring value that interpolates based on changes to the passed signal.
199200
* Works similar to the `@solid-primitives/tween`
200201
*
201202
* @param target Target to be modified.
202203
* @param options Options to configure the physics of the spring.
203-
* @returns Returns the spring value only.
204+
* @returns Returns the spring value accessor only.
204205
*
205206
* @example
206207
* const percent = createMemo(() => current() / total() * 100);
207208
*
208-
* const springedPercent = createDerivedSignal(percent, { stiffness: 0.15, damping: 0.8 });
209+
* const springedPercent = createDerivedSpring(percent, { stiffness: 0.15, damping: 0.8 });
209210
*/
210211
export function createDerivedSpring<T extends SpringTarget>(
211212
target: Accessor<T>,

0 commit comments

Comments
 (0)