Closed jjwill closed 9 years ago
I don't think your path is technically supported. However, here's a workaround:
let obj = { '1': 'one' };
let observer = new PathObserver(obj, '[1]');
observer.open(console.log.bind(console));
obj[1] = 'two'; // console logs: two one PathObserver{ ... }
Ahh, good call; thanks for the workaround @OlsonDev.
I am running into an issue where this.path_ is always undefined for a PathObserver where the key is a number-like string. The transition here, https://github.com/Polymer/observe-js/blob/0.4.0/src/observe.js#L286, always returns 'error' because the type var above is 'number'.
Changing obj will never trigger the changeFn: