clearEventQueue
Version:
|
Type |
Function |
|
Import path |
|
Empties the event queue, removing all the events that are in it, without sending any of the events.
Signature
Return value
Returns a promise.
Examples
Example 38. Running the clearEventQueue function
Next.js
Note
To run this function, you have to first initialize the Cloud SDK.
Here's an example of how to use the clearEventQueue function to empty the event queue.
In this scenario, we add different events to the event queue depending on whether a site visitor clicked a dropdown menu and a dropdown menu item.
If a certain condition is met, you decide to empty the event queue and not send any of the events you previously added to it.