Function#observesImmediately()

observesImmediatelydeprecatedprivate

Defined in packages/ember-runtime/lib/ext/function.js:129

The observesImmediately extension of Javascript's Function prototype is available when EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Function is true, which is the default.

You can observe property changes simply by adding the observesImmediately call to the end of your method declarations in classes that you write. For example:

Ember.Object.extend({
  valueObserver: function() {
    // Executes immediately after the "value" property changes
  }.observesImmediately('value')
});

In the future, observes may become asynchronous. In this event, observesImmediately will maintain the synchronous behavior.

See Ember.immediateObserver.

doc_EmberJs
2016-11-30 16:52:08
Comments
Leave a Comment

Please login to continue.