Event Listeners
Rebuy triggers lifecycle events in order to allow developers to provide additional functionality. Below are the two main overarching events from Rebuy.JS.
Before Load¶
This triggers before Rebuy loads.
Loaded¶
This triggers when Rebuy has fully loaded.
There are additional events specific to the Cart, Smart Cart, and widgets, which can be found in their respective sections of the documentation or through the links below.
--- title: Event Listeners excerpt: '' deprecated: false hidden: false metadata: title: '' description: '' robots: index next: description: '' --- Rebuy triggers lifecycle events in order to allow developers to provide additional functionality. Below are the two main overarching events from Rebuy.JS. ## Before Load This triggers before Rebuy loads. ```javascript document.addEventListener('rebuy.beforeLoaded', (event) => { console.log('rebuy.beforeLoaded'); }); ``` ## Loaded This triggers when Rebuy has fully loaded. ```javascript document.addEventListener('rebuy.loaded', (event) => { console.log('rebuy.loaded'); }); ``` <br /> *** <br /> There are additional events specific to the Cart, Smart Cart, and widgets, which can be found in their respective sections of the documentation or through the links below. * [Cart Event Listeners](cart-event-listeners.md) * [Smart Cart Event Listeners](smart-cart-event-listeners.md) * [Widget Event Listeners](widget-event-listeners.md)