Refactor to worker version

This commit is contained in:
Jerome Wu
2019-10-24 07:47:11 +08:00
parent 99adf5138c
commit 9e5d0c5cc6
42 changed files with 579 additions and 109 deletions

3
src/utils/getId.js Normal file
View File

@@ -0,0 +1,3 @@
module.exports = (prefix, cnt) => (
`${prefix}-${cnt}-${Math.random().toString(16).slice(3, 8)}`
);

9
src/utils/log.js Normal file
View File

@@ -0,0 +1,9 @@
let logging = false;
exports.logging = logging;
exports.setLogging = (_logging) => {
logging = _logging;
};
exports.log = (...args) => (logging ? console.log.apply(this, args) : null);