UNPKG

@humanspeak/svelte-motion

Version:

Framer Motion for Svelte 5. Declarative motion.<tag> components with AnimatePresence exit animations, gestures (hover, tap, drag, focus, in-view), variants, FLIP layout animations, shared-layout transitions, spring physics, and scroll-linked motion values

13 lines (12 loc) 325 B
/** * Return a promise that resolves after the given number of milliseconds. * * @param ms Delay in milliseconds. * @returns A promise that resolves after the delay. * * @example * ```ts * await sleep(100) // pause for 100 ms * ``` */ export const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));