Skip to content

Instantly share code, notes, and snippets.

@yavorski
Created March 31, 2017 11:10
Show Gist options
  • Save yavorski/5dc948378d214e6f0b3b6993ce4b93aa to your computer and use it in GitHub Desktop.
Save yavorski/5dc948378d214e6f0b3b6993ce4b93aa to your computer and use it in GitHub Desktop.
'use strict';
if (!document.interactive) {
document.interactive = () => {
return new Promise((resolve) => {
if (document.readyState !== 'loading') {
resolve();
}
else {
document.addEventListener('readystatechange', () => {
if (document.readyState === 'interactive') {
resolve();
}
});
}
});
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment