Sometimes, my some part of my structured data changes underneath me inside a Javascript library I can't control. The library does not tell me what the changes are, just that something did happen.
I'd like to use data binding mechanism to notify other elements about these changes. Calling this.set() does not propagate the changes, because the value is still the same. What call can I f
Concrete example:
- DataSource: js library that analyzes getUserMedia stream, and calls `callback(eventArray)` when new event happens. eventArray variable is always the same object, to which new events get appended, or old events deleted.
- Polymer({
is: data-source-wrapper,
properties: { events: { type: Array, notify: true } },
start: function() {
dataSource.listen( function(events) {
this.events = events; // I'd like to force event change notification here, bc does not broadcast when events === this.events
}
})
- <dom-module id='event-viewer'>
<template>
<data-source-wrapper events="{{events}}">
<template>
</dom-module>
Polymer( {
observers: {
'events.*', 'eventsChanged'
}
})
How to I force trigger of event-viewer.eventsChanged when dataSource reports a new event?
Aleks