josephsavona/valuable — pull request #5 by josephsavona (2014-08-01 15:46:45+00:00)
Title: Batch notifications (one callback per tick)

This implements the most important part of #3 - changes to only call the root value's `observe()` callbacks once per tick. This means the following will only result in one callback:

```javascript
var app = TodoApp({});
// called only once
app.observe((val) -> console.log(val));

// modifications in one tick are batched
app.get('edit').set('text', 'hello');
app.get('todos').push({text: 'world'});

// but eg a setTimeout would cause another call to observe()ers:
// setTimeout(() -> app.get(...).set(...))
```

Note that this change only delays the notification and not the actual data structure manipulation. Future work will address the issue of delaying modifications to reduce internal cloning (via true immutable data structures).