Easily execute code during Shopify Checkout.
Let's get you all set up!
First install the package.
npm i shopify-checkout-step-manager
yarn add shopify-checkout-step-manager
Once installed, you can then import and start using it in your project:
import { CheckoutStepManager } from 'shopify-checkout-step-manager';
const csm = new CheckoutStepManager();
function runOnRepaint() {
console.log('There was a repaint!');
}
const removeListener = csm.onAnyRepaint().execute(runOnRepaint);
// remove the repaint listener after 3 seconds
setTimeout(removeListener, 3000);