Refactor to worker version
This commit is contained in:
3
src/utils/getId.js
Normal file
3
src/utils/getId.js
Normal 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
9
src/utils/log.js
Normal 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);
|
||||
Reference in New Issue
Block a user