Sha256: ab3c0e2f4e50b0ef1c951e867a3f39a4a024c610ad9ed907b71c859643c7d318
Contents?: true
Size: 1.25 KB
Versions: 25
Compression:
Stored size: 1.25 KB
Contents
"use strict"; var schedule; var util = require("./util"); var noAsyncScheduler = function() { throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/m3OTXk\u000a"); }; if (util.isNode && typeof MutationObserver === "undefined") { var GlobalSetImmediate = global.setImmediate; var ProcessNextTick = process.nextTick; schedule = util.isRecentNode ? function(fn) { GlobalSetImmediate.call(global, fn); } : function(fn) { ProcessNextTick.call(process, fn); }; } else if ((typeof MutationObserver !== "undefined") && !(typeof window !== "undefined" && window.navigator && window.navigator.standalone)) { schedule = function(fn) { var div = document.createElement("div"); var observer = new MutationObserver(fn); observer.observe(div, {attributes: true}); return function() { div.classList.toggle("foo"); }; }; schedule.isStatic = true; } else if (typeof setImmediate !== "undefined") { schedule = function (fn) { setImmediate(fn); }; } else if (typeof setTimeout !== "undefined") { schedule = function (fn) { setTimeout(fn, 0); }; } else { schedule = noAsyncScheduler; } module.exports = schedule;
Version data entries
25 entries across 19 versions & 6 rubygems