Questions tagged [object.observe]

Object.observe() is a proposed mechanism for bringing true data-binding to the browser. It exposes a mechanism for observing changes to objects and arrays, notifying others of mutations made to these objects.

47 questions
55
votes
7 answers

Which browsers support Object.observe?

Which browsers, if any, support Object.observe? I'm surprised I'm unable to find any info on this. (And are you aware about any estimated times of arrival for this feature?) About Object.observe: "Object.observe allows for the direct observation of…
KajMagnus
  • 10,177
  • 14
  • 69
  • 115
13
votes
1 answer

Object.observe -- not supported by all major browsers, what can I use as an alternative?

I have this function that works in Chrome, which prints to the console when a variable called finishedLoading changes values. Object.observe(finishedLoading, function(id, oldval, newval) { console.log('finished loading' + id + ' went from…
pomegranate
  • 715
  • 5
  • 17
13
votes
2 answers

How does Object.observe() affect performance?

The Object.observe() JavaScript API allows any piece of code to receive change notifications for all property changes of any JavaScript object. Doesn't this severely affect the code generation and performance optimizations that can be performed by…
usr
  • 162,013
  • 33
  • 219
  • 345
11
votes
2 answers

Object.observe withdrawal and RxJS and Angular 2

I am a bit confused, because Obejct.observe is said to be withdrawn from the ES2016. On the other hand there were talks on Angular Connect that mentions they will rely on it. So as far I understand Angular 2 doesn't rely on Object.observe directly…
puffy
  • 225
  • 2
  • 9
9
votes
2 answers

Will Object.observe provide a significant boost to Angularjs?

Right now, Angular slows down after a few thousand objects, which prevents us from building something like a spreadsheet or Conway's Game of Life. Once Object.observe is implement (in the far, far future), will these become possible with Angular? Or…
ehfeng
  • 3,449
  • 4
  • 30
  • 40
8
votes
2 answers

Is there a way to modify a observed valued without triggering the observer callback in Polymer

Like the title says. Is there a way to modify a observed valued without triggering the observer callback in Polymer? For example Polymer({ is: 'my-component', properties: { aValue: { type: Number, …
Jeremy Knees
  • 640
  • 1
  • 7
  • 18
7
votes
1 answer

How does Object.observe/unobserve interact with garbage collection?

Does having an active Object.observe on an object prevent it from being garbage collected? Do you need to first call Object.unobserve to allow it to be garbage collected? Or does GCing an object remove all its active observers?
alexp
  • 3,229
  • 2
  • 25
  • 34
7
votes
2 answers

Using change watchers to observe native properties under Object.observe()

Now that Object.observe() is on by default in Chrome, I'm running into a bunch of cases where I want to reuse the browser's built in property (hidden, title, draggable), but *Changed watchers no longer get called when the property changes. One…
ebidel
  • 23,003
  • 2
  • 58
  • 75
5
votes
1 answer

Observing ES6 Module properties

I have a module: var progress = { val: 0 }; var service = (function(){ function someMethod(){ progress.val++; } return{ someMethod: someMethod }; })(); export {service,progress} someMethod will perform an…
user2422960
  • 1,276
  • 5
  • 15
  • 27
5
votes
1 answer

Why does object.observe not work for the value property of an input field?

I was playing with Object.observe in the latest version of Chrome and was wondering why it does not work for the 'value' property of a text input. The code below will log a change for adding/changing the 'foo' property, but not for changing the…
5
votes
1 answer

Is Ember.js Object observer equivalent to ES6 Harmony Object.observe?

Looking at the new observe ES6 featues inside object, I was wondering whether Ember and ES6 are equivalent or different? Can we use the Watchjs polyfill safely with ember?
4
votes
1 answer

Watch if an object has changed

Is it possible to execute some code each time an object has changed ? var a = {x: 12, y: 63}; a.watch(function () { console.log('The object has changed!'); }); a.x = 16; // The object has changed! a.y = 1; // The object has changed! It seems…
Basj
  • 29,668
  • 65
  • 241
  • 451
4
votes
2 answers

What does notifier.performChange actually do?

I am trying to understand Object.getNotifier(object).performChange. Conceptually I understand that it is designed for defining "macro" or higher level changes. From the example everyone seems to refer to: increment: function(amount) { var notifier…
user663031
4
votes
3 answers

Object.Observe Synchronous Callback

I have been experimenting with Object.observe in Chrome v36. My original intent was to use this for business logic in my models, but the asynchronous behaviour seems to make this impossible. I have boiled this down to the following example: function…
Troels Larsen
  • 3,953
  • 2
  • 33
  • 46
4
votes
1 answer

What is the difference between Object.observe and Object.watch

Object.watch: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/watch Object.observe: http://wiki.ecmascript.org/doku.php?id=harmony:observe They both seem do the same thing at a high level. What are the salient…
Transcendence
  • 2,226
  • 2
  • 18
  • 31
1
2 3 4