justinhelmer
8/16/2017 - 9:49 PM

_baseView.refactor.js

export default Backbone.View.extend({
  // ...
  
  // In an ideal world, the Tealium.view() call would be automatically handled by baseView, if MeW had proper lifecycle...
  // Unfortunately this approach will not work. The actual Tealium.view() call will need to happen in every single view,
  // since only the view will know when it's data is all ready (usually will be in postRender).
  render: function () {
    // ...
    
    if (this.tealium) {
      Tealium.view(this.tealium());
    }

    // ...
  },
  
  // ...
});