Skip to content

Instantly share code, notes, and snippets.

@askmike
Created October 28, 2017 02:30
Show Gist options
  • Save askmike/959cada3c68f0bb3904ef08e7db28073 to your computer and use it in GitHub Desktop.
Save askmike/959cada3c68f0bb3904ef08e7db28073 to your computer and use it in GitHub Desktop.
SHORT-LONG-SHORT-LONG
var settings = {
wait: 0,
each: 6
};
// -------
var _ = require('lodash');
var log = require('../core/log.js');
var i = 0;
var method = {
init: _.noop,
update: _.noop,
log: _.noop,
check: function() {
if(settings.wait > i)
return;
log.info('iteration:', i);
if(i % settings.each === 0)
this.advice('short');
else if(i % settings.each === settings.each / 2)
this.advice('long');
i++;
}
};
module.exports = method;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment