mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 02:42:48 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
64
node_modules/next-tick/index.js
generated
vendored
Normal file
64
node_modules/next-tick/index.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
'use strict';
|
||||
|
||||
var callable, byObserver;
|
||||
|
||||
callable = function (fn) {
|
||||
if (typeof fn !== 'function') throw new TypeError(fn + " is not a function");
|
||||
return fn;
|
||||
};
|
||||
|
||||
byObserver = function (Observer) {
|
||||
var node = document.createTextNode(''), queue, i = 0;
|
||||
new Observer(function () {
|
||||
var data;
|
||||
if (!queue) return;
|
||||
data = queue;
|
||||
queue = null;
|
||||
if (typeof data === 'function') {
|
||||
data();
|
||||
return;
|
||||
}
|
||||
data.forEach(function (fn) { fn(); });
|
||||
}).observe(node, { characterData: true });
|
||||
return function (fn) {
|
||||
callable(fn);
|
||||
if (queue) {
|
||||
if (typeof queue === 'function') queue = [queue, fn];
|
||||
else queue.push(fn);
|
||||
return;
|
||||
}
|
||||
queue = fn;
|
||||
node.data = (i = ++i % 2);
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = (function () {
|
||||
// Node.js
|
||||
if ((typeof process !== 'undefined') && process &&
|
||||
(typeof process.nextTick === 'function')) {
|
||||
return process.nextTick;
|
||||
}
|
||||
|
||||
// MutationObserver=
|
||||
if ((typeof document === 'object') && document) {
|
||||
if (typeof MutationObserver === 'function') {
|
||||
return byObserver(MutationObserver);
|
||||
}
|
||||
if (typeof WebKitMutationObserver === 'function') {
|
||||
return byObserver(WebKitMutationObserver);
|
||||
}
|
||||
}
|
||||
|
||||
// W3C Draft
|
||||
// http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/setImmediate/Overview.html
|
||||
if (typeof setImmediate === 'function') {
|
||||
return function (cb) { setImmediate(callable(cb)); };
|
||||
}
|
||||
|
||||
// Wide available standard
|
||||
if (typeof setTimeout === 'function') {
|
||||
return function (cb) { setTimeout(callable(cb), 0); };
|
||||
}
|
||||
|
||||
return null;
|
||||
}());
|
||||
Reference in New Issue
Block a user