solid-primitives
solid-primitives copied to clipboard
Running in a worker throws Uncaught ReferenceError: window is not defined
Describe the bug
I am trying to run captureStoreUpdates in another thread, and I'm getting Uncaught ReferenceError: window is not defined. This seems to be due to the scheduleIdle fn trying to call window.requestIdleCallback. I'm suggesting a change where we check typeof window and fallback to throttle in the case that it doesn't exist, like what is done for when requestIdleCallback is not defined
Minimal Reproduction Link
https://stackblitz.com/edit/github-vu8q2i?file=src%2Fworker.ts