library refactoring

This commit is contained in:
Aliaksei Chapyzhenka 2019-11-10 18:12:07 -08:00
parent 47fd7856e2
commit beb912ee83

View File

@ -1,6 +1,6 @@
'use strict';
exports.and = () => {
module.exports = () => {
let state = 0; // idle
let total = 0;
let start = 0;
@ -45,21 +45,3 @@ exports.and = () => {
time: () => total + start
};
};
exports.activity = skip => {
let start = 0;
let stop = 0;
return {
on: time => {
if (time > skip) {
if (start == 0) {
start = time;
} else {
stop = time;
}
}
},
time: () => stop - start
};
};