Created
October 28, 2017 02:30
-
-
Save askmike/959cada3c68f0bb3904ef08e7db28073 to your computer and use it in GitHub Desktop.
SHORT-LONG-SHORT-LONG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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