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:
33
node_modules/timers-ext/once.js
generated
vendored
Normal file
33
node_modules/timers-ext/once.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
var callable = require('es5-ext/object/valid-callable')
|
||||
, nextTick = require('next-tick')
|
||||
, validTimeout = require('./valid-timeout');
|
||||
|
||||
module.exports = function (fn/*, timeout*/) {
|
||||
var scheduled, run, context, args, delay, index, timeout = arguments[1];
|
||||
callable(fn);
|
||||
if (timeout === undefined) {
|
||||
delay = nextTick;
|
||||
} else {
|
||||
timeout = validTimeout(timeout);
|
||||
delay = setTimeout;
|
||||
}
|
||||
run = function () {
|
||||
scheduled = false;
|
||||
index = null;
|
||||
fn.apply(context, args);
|
||||
context = null;
|
||||
args = null;
|
||||
};
|
||||
return function () {
|
||||
if (scheduled) {
|
||||
if (index == null) return;
|
||||
clearTimeout(index);
|
||||
}
|
||||
scheduled = true;
|
||||
context = this;
|
||||
args = arguments;
|
||||
index = delay(run, timeout);
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user