I need to listen to following events and do action accordingly
Form submit event - if the form submission is successful, I need to broadcast success event
Added Name Recordand submit the data along with it to 3rd party service. If not, I need to broadcast a failed event sayName submission failedalong with where the error occurred.Page visit/Route Change - Self explanatory
Click events - Can be from list item click and button click. In case of list item need to pass item details and in case of button just the name maybe
Searches - Any searches made should fire the event sending the keyword.
I am using React - 0.13 and Reflux store.
How can I approach towards it to handle the events at a global level and without writing code at each button click/submit event/search etc ?
What is the best approach ? Body handler won't be enough I feel for this level of customisation required!
P.S - When I say broadcast let's assume that I have a 3rd party function call to make instead.