Created
May 15, 2021 18:35
-
-
Save gaurangrshah/4d236adb939425ed22d86cde782bd5af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkFonts() { | |
document.fonts.onloadingdone = function (fontFaceSetEvent) { | |
console.log( | |
"🚀 ~ file: default.js ~ line 27 ~ checkFonts ~ fontFaceSetEvent", | |
fontFaceSetEvent | |
); | |
alert( | |
"onloadingdone we have " + | |
fontFaceSetEvent.fontfaces.length + | |
" font faces loaded" | |
); | |
}; | |
} | |
/* | |
* USAGE: | |
useEffect(() => { | |
console.log(checkFonts()); | |
}, []); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment