woocommerce-paypal-payments/modules/ppcp-googlepay/resources/js/boot-admin.js
Philipp Stracker 4ca309768e
♻️ Extract the GooglePayPreviewButton to own file
Also note the change in line 43 (new file) where we use `new GooglepayButton` instead of `GooglepayButton.createButton`
2024-08-08 14:09:43 +02:00

16 lines
450 B
JavaScript

import GooglePayPreviewButtonManager from './Preview/GooglePayPreviewButtonManager';
/**
* Accessor that creates and returns a single PreviewButtonManager instance.
*/
const buttonManager = () => {
if ( ! GooglePayPreviewButtonManager.instance ) {
GooglePayPreviewButtonManager.instance =
new GooglePayPreviewButtonManager();
}
return GooglePayPreviewButtonManager.instance;
};
// Initialize the preview button manager.
buttonManager();