-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Instead of such syntax:
const partOfLibName = 'part1';
const myLib = require(partOfLibName + 'LibName');Please, use such one:
cosnt myLib1 = require('part1LibName');
cosnt myLib2 = require('part2LibName');
// and later
let res;
if (/* some condition here */) {
res = myLib1.method();
} else {
res = myLib2.method();
}Or with dynamic imports:
cosnt myLib1 = import('part1LibName');
cosnt myLib2 = import('part2LibName');
// and later
let res;
if (/* some condition here */) {
myLib1.then(res => {
// user res here
});
} else {
myLib2.then(res => {
// user res here
});
}Metadata
Metadata
Assignees
Labels
No labels