From 26bb11802f5320802d81ee19d51cbba53e5d05b6 Mon Sep 17 00:00:00 2001 From: Edie Lemoine Date: Fri, 27 Sep 2024 13:58:35 +0200 Subject: [PATCH] refactor: remove unused function --- .../src/__snapshots__/index.spec.ts.snap | 1 - apps/delivery-options/src/composables/index.ts | 1 - .../src/composables/useCarrierSettings.ts | 12 ------------ .../src/utils/getResolvedValue.spec.ts | 7 +------ 4 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 apps/delivery-options/src/composables/useCarrierSettings.ts diff --git a/apps/delivery-options/src/__snapshots__/index.spec.ts.snap b/apps/delivery-options/src/__snapshots__/index.spec.ts.snap index fc590f42..9fb68e40 100644 --- a/apps/delivery-options/src/__snapshots__/index.spec.ts.snap +++ b/apps/delivery-options/src/__snapshots__/index.spec.ts.snap @@ -87,7 +87,6 @@ exports[`exports > exports from index.ts 1`] = ` "useActiveCarriers", "useAddressStore", "useBreakpoints", - "useCarrierSettings", "useConfigStore", "useCurrentPlatform", "useDateFormat", diff --git a/apps/delivery-options/src/composables/index.ts b/apps/delivery-options/src/composables/index.ts index f960ef80..8e05772b 100644 --- a/apps/delivery-options/src/composables/index.ts +++ b/apps/delivery-options/src/composables/index.ts @@ -1,7 +1,6 @@ export * from './events'; export * from './useActiveCarriers'; export * from './useBreakpoints'; -export * from './useCarrierSettings'; export * from './useCurrentPlatform'; export * from './useDateFormat'; export * from './useFeatures'; diff --git a/apps/delivery-options/src/composables/useCarrierSettings.ts b/apps/delivery-options/src/composables/useCarrierSettings.ts deleted file mode 100644 index 80bd6786..00000000 --- a/apps/delivery-options/src/composables/useCarrierSettings.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {computed, type ComputedRef} from 'vue'; -import {useMemoize} from '@vueuse/core'; -import {type CarrierIdentifier, type CarrierSettings} from '@myparcel-do/shared'; -import {useConfigStore} from '../stores'; - -export const useCarrierSettings = useMemoize( - (carrierIdentifier: CarrierIdentifier): ComputedRef => { - const store = useConfigStore(); - - return computed(() => store.carrierSettings[carrierIdentifier] ?? null); - }, -); diff --git a/apps/delivery-options/src/utils/getResolvedValue.spec.ts b/apps/delivery-options/src/utils/getResolvedValue.spec.ts index 058331f0..6d98be16 100644 --- a/apps/delivery-options/src/utils/getResolvedValue.spec.ts +++ b/apps/delivery-options/src/utils/getResolvedValue.spec.ts @@ -1,8 +1,7 @@ -import {afterEach, beforeEach, describe, expect, it} from 'vitest'; +import {beforeEach, describe, expect, it} from 'vitest'; import {createPinia, setActivePinia} from 'pinia'; import {CarrierSetting, KEY_CARRIER_SETTINGS, KEY_CONFIG} from '@myparcel-do/shared'; import {CarrierName} from '@myparcel/constants'; -import {useCarrierSettings} from '../composables'; import {mockDeliveryOptionsConfig} from '../__tests__'; import {getResolvedValue} from './getResolvedValue'; @@ -11,10 +10,6 @@ describe('getResolvedValue', () => { setActivePinia(createPinia()); }); - afterEach(() => { - useCarrierSettings.clear(); - }); - it('returns the general value when no carrier is given', () => { mockDeliveryOptionsConfig({ [KEY_CONFIG]: {