* Create a tween whose value is bound to the return value of `fn`. This must be called * inside an effect root (for example, during component initialisation). * * ```svelte * * import { Tween } from 'svelte/motion'; * * let { number } = $props(); * * const tween = Tween
(fn, options)
| 218 | * @param {TweenOptions<U>} [options] |
| 219 | */ |
| 220 | static of(fn, options) { |
| 221 | const tween = new Tween(fn(), options); |
| 222 | |
| 223 | render_effect(() => { |
| 224 | tween.set(fn()); |
| 225 | }); |
| 226 | |
| 227 | return tween; |
| 228 | } |
| 229 | |
| 230 | /** |
| 231 | * Sets `tween.target` to `value` and returns a `Promise` that resolves if and when `tween.current` catches up to it. |
nothing calls this directly
no test coverage detected