How to get the observes('x').on('init') without prototype extensions?

What is the idiomatic way to write

myObserver: function() {
// Some stuff here
}.observes('x').on('init')

without function prototypes?

Hello, try this one:

myObserver: Ember.on('init', Ember.observer('x', function () {
    // Some stuff here
}))
1 Like

Thank you, @od1n, I have similar code but I thought there might be some nicer way. Guess we’ll need to wait for the decorator implementation :smile:

Thank you!