Skip to content

Commit b07ab07

Browse files
authored
feat(cart-customer): create injection tokens with factory (#3236)
1 parent f96294f commit b07ab07

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import { InjectionToken } from '@angular/core';
2-
1+
import { createSingleInjectionToken } from '@daffodil/core';
32
import { daffTransformErrorToStateError } from '@daffodil/core/state';
43

5-
/**
6-
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
7-
* Can be used to further refine Daffodil errors into more specific app errors.
8-
*/
9-
export const DAFF_CART_CUSTOMER_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(
4+
export const {
5+
/**
6+
* Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.
7+
* Can be used to further refine Daffodil errors into more specific app errors.
8+
*/
9+
token: DAFF_CART_CUSTOMER_ERROR_MATCHER,
10+
provider: daffProvideCartCustomerErrorMatcher,
11+
} = createSingleInjectionToken<typeof daffTransformErrorToStateError>(
1012
'DAFF_CART_CUSTOMER_ERROR_MATCHER',
1113
{ factory: () => daffTransformErrorToStateError },
1214
);
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { DAFF_CART_CUSTOMER_ERROR_MATCHER } from './error-matcher.token';
1+
export * from './error-matcher.token';

0 commit comments

Comments
 (0)