Replace Laravel Mix with Bud (#2643)
Co-authored-by: QWp6t <hi@qwp6t.me> Co-authored-by: Ben Word <ben@benword.com>
This commit is contained in:
12
resources/scripts/components/index.js
Normal file
12
resources/scripts/components/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Calls a supplied function once
|
||||
* document has loaded.
|
||||
*
|
||||
* @param {CallableFunction} onReady
|
||||
* @return {void}
|
||||
*/
|
||||
export const domReady = (onReady) => {
|
||||
window.requestAnimationFrame(function check() {
|
||||
document.body ? onReady() : window.requestAnimationFrame(check);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user