Is it possible to extend Ember class on condition? Something like this:
A.reopen({
if (condition) {
init: function() {
this.super();
// some functionality
}.on('didInsertElement');
}
})
Currently I have such pattern:
A.reopen({
init: function() {
this.super();
if (condition) {
// some stuff
}
}.on('didInsertElement'),
cleanup: function() {
if (condition) {
// some stuff
}
}.on('willDestroyElement')
})
I guessed if I can extend A class on condition I can simplify my pattern like this:
A.reopen({
if (condition) {
init: function() {
this.super();
// some functionality
}.on('didInsertElement'),
clear_up: function() {
// some stuff
}.on('willDestroyElement')
}
})
All class extensions made in the plugin for discourse