Skip to content

Commit

Permalink
await initializers (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
fnhipster authored Nov 7, 2024
1 parent 1eaa129 commit a1c8172
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions scripts/initializers/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { initialize } from '@dropins/storefront-account/api.js';
import { initializeDropin } from './index.js';
import { fetchPlaceholders } from '../aem.js';

initializeDropin(async () => {
await initializeDropin(async () => {
const labels = await fetchPlaceholders();

const langDefinitions = {
Expand All @@ -12,5 +12,5 @@ initializeDropin(async () => {
},
};

await initializers.mountImmediately(initialize, { langDefinitions });
return initializers.mountImmediately(initialize, { langDefinitions });
})();
4 changes: 2 additions & 2 deletions scripts/initializers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { initialize } from '@dropins/storefront-auth/api.js';
import { initializeDropin } from './index.js';
import { fetchPlaceholders } from '../aem.js';

initializeDropin(async () => {
await initializeDropin(async () => {
const labels = await fetchPlaceholders();

const langDefinitions = {
Expand All @@ -13,5 +13,5 @@ initializeDropin(async () => {
},
};

await initializers.mountImmediately(initialize, { langDefinitions });
return initializers.mountImmediately(initialize, { langDefinitions });
})();
4 changes: 2 additions & 2 deletions scripts/initializers/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { initialize } from '@dropins/storefront-cart/api.js';
import { initializeDropin } from './index.js';
import { fetchPlaceholders } from '../aem.js';

initializeDropin(async () => {
await initializeDropin(async () => {
const labels = await fetchPlaceholders();

const langDefinitions = {
Expand All @@ -13,5 +13,5 @@ initializeDropin(async () => {
},
};

await initializers.mountImmediately(initialize, { langDefinitions });
return initializers.mountImmediately(initialize, { langDefinitions });
})();
4 changes: 2 additions & 2 deletions scripts/initializers/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { initialize } from '@dropins/storefront-checkout/api.js';
import { initializeDropin } from './index.js';
import { fetchPlaceholders } from '../aem.js';

initializeDropin(async () => {
await initializeDropin(async () => {
const labels = await fetchPlaceholders();

const langDefinitions = {
Expand All @@ -12,5 +12,5 @@ initializeDropin(async () => {
},
};

await initializers.mountImmediately(initialize, { langDefinitions });
return initializers.mountImmediately(initialize, { langDefinitions });
})();
4 changes: 2 additions & 2 deletions scripts/initializers/order-confirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { initialize } from '@dropins/storefront-order-confirmation/api.js';
import { initializeDropin } from './index.js';
import { fetchPlaceholders } from '../aem.js';

initializeDropin(async () => {
await initializeDropin(async () => {
const labels = await fetchPlaceholders();

const langDefinitions = {
Expand All @@ -12,5 +12,5 @@ initializeDropin(async () => {
},
};

await initializers.mountImmediately(initialize, { langDefinitions });
return initializers.mountImmediately(initialize, { langDefinitions });
})();
2 changes: 1 addition & 1 deletion scripts/initializers/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
CUSTOMER_PATH,
} from '../constants.js';

initializeDropin(async () => {
await initializeDropin(async () => {
const { pathname, searchParams } = new URL(window.location.href);
const isAccountPage = pathname.includes(CUSTOMER_PATH);
const orderRef = searchParams.get('orderRef');
Expand Down
2 changes: 1 addition & 1 deletion scripts/initializers/pdp.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ await initializeDropin(async () => {
};

// Initialize Dropins
await initializers.mountImmediately(initialize, {
return initializers.mountImmediately(initialize, {
langDefinitions,
models,
});
Expand Down

0 comments on commit a1c8172

Please sign in to comment.