diff --git a/libs/cart-customer/state/src/injection-tokens/error-matcher.token.ts b/libs/cart-customer/state/src/injection-tokens/error-matcher.token.ts index 65f2e69789..11dd4dac6b 100644 --- a/libs/cart-customer/state/src/injection-tokens/error-matcher.token.ts +++ b/libs/cart-customer/state/src/injection-tokens/error-matcher.token.ts @@ -1,12 +1,14 @@ -import { InjectionToken } from '@angular/core'; - +import { createSingleInjectionToken } from '@daffodil/core'; import { daffTransformErrorToStateError } from '@daffodil/core/state'; -/** - * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state. - * Can be used to further refine Daffodil errors into more specific app errors. - */ -export const DAFF_CART_CUSTOMER_ERROR_MATCHER = new InjectionToken( +export const { + /** + * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state. + * Can be used to further refine Daffodil errors into more specific app errors. + */ + token: DAFF_CART_CUSTOMER_ERROR_MATCHER, + provider: daffProvideCartCustomerErrorMatcher, +} = createSingleInjectionToken( 'DAFF_CART_CUSTOMER_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError }, ); diff --git a/libs/cart-customer/state/src/injection-tokens/public_api.ts b/libs/cart-customer/state/src/injection-tokens/public_api.ts index 3409b4a60d..315411d8fd 100644 --- a/libs/cart-customer/state/src/injection-tokens/public_api.ts +++ b/libs/cart-customer/state/src/injection-tokens/public_api.ts @@ -1 +1 @@ -export { DAFF_CART_CUSTOMER_ERROR_MATCHER } from './error-matcher.token'; +export * from './error-matcher.token';