I have the following class definition:
class EmberReflux{
static createActions(actions) {
console.log(actions);
}
}
export { EmberReflux };
When I import it from a different file:
import EmberReflux from '../utils/ember-reflux';
let TodoActions = EmberReflux.createActions(
[
"addItem",
"undo",
"redo"
]);
export { TodoActions };
The transpiled looks like this
define('ember-reflux/utils/todo-actions', ['exports', 'ember-reflux/utils/ember-reflux'], function (exports, EmberReflux) {
'use strict';
var TodoActions = EmberReflux['default'].createActions(["addItem", "undo", "redo"]);
exports.TodoActions = TodoActions;
});
I'm not sure what the default is in EmberReflux['default']
I want to call the static class method like this:
EmberReflux.createActions
But instead I have to call it like this:
EmberReflux.EmberReflux.createActions
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…