Event Hooks

Integration relation event hooks

You can implement various event hooks from within your component file to respond to certain events that take place during the lifecycle of your integration.

onDetailsOpened

This hook fires after the details block has opened and the DOM for the details block has finished loading. This hook will fire multiple times if the user opens and closes the details block.

components/component.js
polarity.export = PolarityComponent.extend({
   onDetailsOpened: function(){
      // executed after the user has expanded the details block and the
      // DOM is fully loaded. 
   }         
});

onDetailsClosed

This hook fires after the details block is closed by the user. This hook can fire multiple times if the user opens and closes the details hook.

components/component.js
polarity.export = PolarityComponent.extend({
   onDetailsClosed: function(){
      // executed after the user has closed the details block
   }         
});

onDetailsComplete

This hook fires when the details block has fully loaded its data including and data that might be fetched from the onDetails hook on the server. Unlike the onDetailsOpened hook, the onDetailsComplete hook will only fire once after the details data is loaded.

components/component.js
polarity.export = PolarityComponent.extend({
   onDetailsComplete: function(){
      // executed after the details block has fully loaded its data including
      // data fetched by a server side `onDetails` implementation.
   }         
});

onDetailsError

This hook fires if there was an error loading the details (i.e., the onDetails hook on the server returned an error).

components/component.js
polarity.export = PolarityComponent.extend({
   onDetailsError: function(error){
      // executed if the `onDetails` 
   }         
});

Last updated