is there any way to obtain a reference to (and use) an es6/2015 import in the same expression?

38 views Asked by At

in node (common-js), i can do something similar to the following:

resultA = require('objectA').key1;
//
resultB = require('functionB')(42);
//
resultC = require('functionC')();

with es6/2015 modules, i'm currently using something similar to this:

import objectA from 'objectA'; 
resultA = objectA.key1;
//
import functionB from 'functionB'; 
resultB = functionB(42);
//
import functionC from 'functionC'; 
resultC = functionC();

is there a short-hand syntax available, or is this the most concise way of accomplishing the desired behavior?

0

There are 0 answers