javascript - import and call a function with es6 -
this question has answer here:
- pass options es6 module imports 4 answers
previously:
var debug = require('debug')('http') , http = require('http') , name = 'my app';
with es6, how can import , invoke right away first line?
import debug 'debug'();
is no no?
you'll need 2 lines:
import debugmodule 'debug'; const debug = debugmodule('http');
the import syntax declarative import syntax, not execute functions.
Comments
Post a Comment