mercredi 6 janvier 2016

Accepted practice for an ES6 module imported just for side-effects?

I like to keep my code modular, so I put this kind of code in a separate file (overrides/extra.js):

import Ember from 'ember';

Ember.RSVP.configure('onerror', function(error) {
    ....
});

export default null;

This has only the side effect of configuring Ember.RSVP but does not export anything of value. I would then import this in app.js:

import dummy from './overrides/extra';

Is this accepted practice?




Aucun commentaire:

Enregistrer un commentaire