Skip to content

Commit

Permalink
✨ onbeforecreate injection
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMyzrailGorynych committed Jul 30, 2020
1 parent 1f7aafa commit b630b7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/data/ct.release/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ const Copy = (function Copy() {
} else {
ct.types.list[type] = [this];
}
this.onBeforeCreateModifier();
ct.types.templates[type].onCreate.apply(this);
}
return this;
Expand Down Expand Up @@ -318,6 +319,12 @@ const Copy = (function Copy() {
}
return parent;
}

// eslint-disable-next-line class-methods-use-this
onBeforeCreateModifier() {
// Filled by ct.IDE and catmods
/*%onbeforecreate%*/
}
}
return Copy;
})();
Expand Down
1 change: 1 addition & 0 deletions src/node_requires/exporter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const exportCtProject = async (project, projdir) => {
start: '',
switch: '',

onbeforecreate: '',
oncreate: '',
ondestroy: '',

Expand Down

0 comments on commit b630b7d

Please sign in to comment.