import class and call static method with es6 modules with babel transpiler
I don't have enough reputation to comment, the alexpods's answer is perfect, but for matters of understanding our friend Ced asked:
Why do we need the default in the 2nd example ? In other words why can't we have export EmberReflux directly ?
When you wrote like this:
export { EmberReflux };
It's the same writing like this:
export { EmberReflux: EmberReflux };
That's why you need to run EmberReflux.EmberReflux, the solution is very simple:
export default EmberReflux;
You have two options:
Export
EmberReflux
like you are doing:export { EmberReflux };
and then import it like:
import { EmberReflux } from '../utils/ember-reflux';
Use
default
when exporting:export default EmberReflux;
and import it (like you are doing):
import EmberReflux from '../utils/ember-reflux';
In both cases you can then use your EmberReflux
like:
EmberReflux.createActions();