Skip to content

Commit fbf247d

Browse files
committed
rename to onAnimationFrame
1 parent db90c4c commit fbf247d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/svelte/src/index-client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,15 @@ export function afterUpdate(fn) {
199199
}
200200

201201
/**
202-
* The `onFrame` function schedules a callback to run on `requestAnimationFrame`. It must be called inside an effect (e.g. during component initialisation).
202+
* The `onAnimationFrame` function schedules a callback to run on `requestAnimationFrame`. It must be called inside an effect (e.g. during component initialisation).
203203
*
204-
* `onFrame` does not run inside [server-side components](https://svelte.dev/docs/svelte/svelte-server#render).
204+
* `onAnimationFrame` does not run inside [server-side components](https://svelte.dev/docs/svelte/svelte-server#render).
205205
*
206206
* @template T
207207
* @param {() => NotFunction<T> | Promise<NotFunction<T>> | (() => any)} fn
208208
* @returns {void}
209209
*/
210-
export function onFrame(fn) {
210+
export function onAnimationFrame(fn) {
211211
onMount(() => {
212212
let frame = -1;
213213

packages/svelte/src/index-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function onDestroy(fn) {
1212
export {
1313
noop as beforeUpdate,
1414
noop as afterUpdate,
15-
noop as onFrame,
15+
noop as onAnimationFrame,
1616
noop as onMount,
1717
noop as flushSync,
1818
run as untrack

packages/svelte/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,12 @@ declare module 'svelte' {
411411
* */
412412
export function afterUpdate(fn: () => void): void;
413413
/**
414-
* The `onFrame` function schedules a callback to run on `requestAnimationFrame`. It must be called inside an effect (e.g. during component initialisation).
414+
* The `onAnimationFrame` function schedules a callback to run on `requestAnimationFrame`. It must be called inside an effect (e.g. during component initialisation).
415415
*
416-
* `onFrame` does not run inside [server-side components](https://svelte.dev/docs/svelte/svelte-server#render).
416+
* `onAnimationFrame` does not run inside [server-side components](https://svelte.dev/docs/svelte/svelte-server#render).
417417
*
418418
* */
419-
export function onFrame<T>(fn: () => NotFunction<T> | Promise<NotFunction<T>> | (() => any)): void;
419+
export function onAnimationFrame<T>(fn: () => NotFunction<T> | Promise<NotFunction<T>> | (() => any)): void;
420420
/**
421421
* Create a snippet programmatically
422422
* */

0 commit comments

Comments
 (0)