You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
414 B
18 lines
414 B
'use strict';
|
|
|
|
exports.test = function () {
|
|
if (global.setImmediate) {
|
|
// we can only get here in IE10
|
|
// which doesn't handel postMessage well
|
|
return false;
|
|
}
|
|
return typeof global.MessageChannel !== 'undefined';
|
|
};
|
|
|
|
exports.install = function (func) {
|
|
var channel = new global.MessageChannel();
|
|
channel.port1.onmessage = func;
|
|
return function () {
|
|
channel.port2.postMessage(0);
|
|
};
|
|
}; |