Skip to content

Commit

Permalink
Update clearAllAuctions.md
Browse files Browse the repository at this point in the history
  • Loading branch information
patmmccann committed Jul 2, 2024
1 parent d3e45cf commit 8b858e5
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion dev-docs/publisher-api-reference/clearAllAuctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,23 @@ sidebarType: 1
Utility to clear all ad units of bids. This is useful for testing or to clear caches in a single page application.

```javascript
pbjs.clearAllAuctions();
// Function to call when the URL changes
function onUrlChange() {
pbjs.clearAllAuctions();
}

// Function to initialize the URL change listener
function initUrlChangeListener() {
// Listen for changes to the history state
window.addEventListener('popstate', onUrlChange);

// Optionally, you might want to handle the initial load as well
onUrlChange();
}

// Call the function to set up the listener
initUrlChangeListener();

```

<hr class="full-rule" />

0 comments on commit 8b858e5

Please sign in to comment.