By default, observers 'initialise' with an undefined oldValue
- the idea is that it's often easier to write a single function that does something with the current state of the app, regardless of how that state came to be, rather than some initial setup logic plus a separate change handler of some kind.
But you can disable that first call by passing an init: false
option, like so:
ractive.observe('foo', handler, { init: false });
However there's a bit more to it than that in this case. It turns out you've uncovered a bug - pattern observers can't have a *
as the first key. You'd need to use invoices.*.date_modified
instead of *.*.date_modified
. An issue has been raised on GitHub - thanks!