I need to detect record-updates by different sources as stated here: Lightning Components: how to use events to detect record updates?
For this example, I'm using the standard Record Detail compo on a Flexipage.
I don't like it, but unfortunately the only viable approach seems to handle the force:refreshView seem to be the only way to detect updates. I handle them like like that:
Markup
<aura:handler event="force:refreshView" action="{!c.events}" />
Controller
events : function(cmp, evt, hlp){
console.log('HANDLER');
},
Result
Now 'HANDLER' appears exactly 4 times in my console per subscribing component I have on the Flexipage. Why that?
Expected
Each handler should get called once per subscribing component.
Best Answer
Only workaround I found so far is building a throttle
The standard component is hammering usually it's 4 bullets within less than 50ms so it seems to work. But hackish as hell and still no explanation why it's necessary at all.