Skip to content

Commit

Permalink
refactor(gwr service): use constructor instead of init
Browse files Browse the repository at this point in the history
  • Loading branch information
velrest committed Apr 12, 2021
1 parent 2ccb328 commit 9ea9f40
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addon/services/gwr.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export default class GwrService extends Service {

_cache = {};

constructor(...args) {
super(...args);
this._setupHandlebarsPartials();
}

createAndCacheProject(xml) {
const project = new ConstructionProject(xml);
this._cache[project.EPROID] = project;
Expand Down Expand Up @@ -177,11 +182,6 @@ export default class GwrService extends Service {
_hbs = Handlebars;
_compiledTemplates = {};

init(...args) {
super.init(...args);
this._setupHandlebarsPartials();
}

_buildXMLRequest(type, model, reason = "Modification enregistrement") {
// Compile the needed templates on the fly so only
// the ones used are compiled to remove a bit of over head.
Expand Down

0 comments on commit 9ea9f40

Please sign in to comment.