fix: Resolve TypeScript errors
Signed-off-by: Hermes Agent <hermes@nosuchhost>
This commit is contained in:
24
client/node_modules/immediate/lib/stateChange.js
generated
vendored
Normal file
24
client/node_modules/immediate/lib/stateChange.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
exports.test = function () {
|
||||
return 'document' in global && 'onreadystatechange' in global.document.createElement('script');
|
||||
};
|
||||
|
||||
exports.install = function (handle) {
|
||||
return function () {
|
||||
|
||||
// Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
|
||||
// into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
|
||||
var scriptEl = global.document.createElement('script');
|
||||
scriptEl.onreadystatechange = function () {
|
||||
handle();
|
||||
|
||||
scriptEl.onreadystatechange = null;
|
||||
scriptEl.parentNode.removeChild(scriptEl);
|
||||
scriptEl = null;
|
||||
};
|
||||
global.document.documentElement.appendChild(scriptEl);
|
||||
|
||||
return handle;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user