* Create a spring whose value is bound to the return value of `fn`. This must be called * inside an effect root (for example, during component initialisation). * * ```svelte * <script> * import { Spring } from 'svelte/motion'; * * let { number } = $props(); * * const spring = Sp
(fn, options)
| 228 | * @param {SpringOptions} [options] |
| 229 | */ |
| 230 | static of(fn, options) { |
| 231 | const spring = new Spring(fn(), options); |
| 232 | |
| 233 | render_effect(() => { |
| 234 | spring.set(fn()); |
| 235 | }); |
| 236 | |
| 237 | return spring; |
| 238 | } |
| 239 | |
| 240 | /** @param {T} value */ |
| 241 | #update(value) { |
nothing calls this directly
no test coverage detected