We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30bf2f6 commit 3430305Copy full SHA for 3430305
packages/svelte/src/internal/client/dom/task.js
@@ -12,7 +12,12 @@ export const request_idle_callback =
12
export const schedule_yield =
13
// @ts-ignore
14
typeof scheduler === 'undefined'
15
- ? (/** @type {() => void} */ cb) => setTimeout(cb, 1)
+ ? (/** @type {() => void} */ cb) => {
16
+ // For Safari, we fallback to using MessageChannel
17
+ const channel = new MessageChannel();
18
+ channel.port1.onmessage = cb;
19
+ channel.port2.postMessage(undefined);
20
+ }
21
: async (/** @type {() => void} */ fn) => {
22
23
await scheduler.yield();
0 commit comments