I'm porting a React hook to Svelte 4. The hook uses React's useLayoutEffect. According to the React docs:
useLayoutEffect is a version of useEffect that fires before the browser repaints the screen.
Is there an simple way to replicate this functionality in Svelte either through a built in utility or with a custom function?
The closest equivalent is Svelte's onMount function.