Skip to content

Instantly share code, notes, and snippets.

@shisama shisama/export.js
Last active Nov 28, 2019

Embed
What would you like to do?
export default () => {
console.log("default export")
}
export function printArg(arg) {
console.log(arg)
}
export function throwError() {
throw Error("error!");
}
export default () => {
console.log("default export2")
}
export function printArg(arg) {
console.log(arg, '2')
}
export function throwError() {
throw Error("error2!");
}
let importModule;
if (someBool) {
importModule = import('./export.js');
} else {
importModule = import('./export2.js');
}
importModule.then(module => {
module.default();
module.printArg('Hello');
module.throwError();
}).catch(e => {
console.error(e)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.