`notifyPath` after a property is `delete`d
notifyPath seems to first check for changes and if it doesn't find changes it won't do anything. If we delete a property on an object and next trigger
this.notifyPath('object', this.object);
nothing will happen, so it would be useful to either have a force flag on notifyPath, or alternatively have it properly realize something changed at least.
related https://github.com/Polymer/polymer/issues/2447, https://github.com/Polymer/polymer/issues/2565
I suggest generalising this to any case of object properties change without reference change. I have a case where I want to notifyPath on multiple properties at a time, and currently this is not possible. I propose adding something like this:
this.notifyPath('obj.*', obj);
which would make notifyPath bypass the reference equality check and would work for multiple properties change and deletion.
I would find this useful as well. In my case I am changing multiple properties on an array element provided by an external library, but I am not adding or removing any array elements. As it stands right now I have to call notifyPath for each changed property. A single call would be preferable.
This would be usefull to me too. I'am working with json schema and I sometime need to delete properties. I also suggest something like this:
this.delete('parentProperty.childProperty'); (since there's no value to notify, we need another pipeline for this).
Still an issue with Polymer 2: http://jsbin.com/dolukotoso/edit?html,console,output
For the time being, here's what I use as a workaround:
delete this.objectName[propertyName];
this.notifyPath(`objectName.${propertyName}`, false)
Closing this as duplicate of #2565