Function to be used in Single Page Applications (SPA) when navigating between content

The destroySlots() function is designed to be used on SPA pages (React, etc) - in between page views. It will reset some internal state in the Relevant Yield script and reset ad slots in the ad server. The latter includes:


// No need to use relevantDigital.cmd.push()
// as we only needs to call the function
// If the library is indeed initialized.

if(window.relevantDigital && relevantDigital.destorySlots) {