diff --git a/libs/geography/driver/src/interfaces/geography-service.interface.ts b/libs/geography/driver/src/interfaces/geography-service.interface.ts index d378ff3b75..3e6f187b7e 100644 --- a/libs/geography/driver/src/interfaces/geography-service.interface.ts +++ b/libs/geography/driver/src/interfaces/geography-service.interface.ts @@ -1,9 +1,12 @@ -import { InjectionToken } from '@angular/core'; import { Observable } from 'rxjs'; +import { createSingleInjectionToken } from '@daffodil/core'; import { DaffCountry } from '@daffodil/geography'; -export const DaffGeographyDriver = new InjectionToken<DaffGeographyServiceInterface>('DaffGeographyDriver'); +export const { + token: DaffGeographyDriver, + provider: daffProvideGeographyDriver, +} = createSingleInjectionToken<DaffGeographyServiceInterface>('DaffGeographyDriver'); export interface DaffGeographyServiceInterface<T extends DaffCountry = DaffCountry> { /** diff --git a/libs/geography/state/src/injection-tokens/error-matcher.token.ts b/libs/geography/state/src/injection-tokens/error-matcher.token.ts index e1e5f99a18..3294402222 100644 --- a/libs/geography/state/src/injection-tokens/error-matcher.token.ts +++ b/libs/geography/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_GEOGRAPHY_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>( +export const { + token: DAFF_GEOGRAPHY_ERROR_MATCHER, + provider: daffProvideGeographyErrorMatcher, +} = createSingleInjectionToken<typeof daffTransformErrorToStateError>( 'DAFF_GEOGRAPHY_ERROR_MATCHER', { factory: () => daffTransformErrorToStateError }, ); diff --git a/libs/geography/state/src/injection-tokens/public_api.ts b/libs/geography/state/src/injection-tokens/public_api.ts index 80d47e24f6..315411d8fd 100644 --- a/libs/geography/state/src/injection-tokens/public_api.ts +++ b/libs/geography/state/src/injection-tokens/public_api.ts @@ -1 +1 @@ -export { DAFF_GEOGRAPHY_ERROR_MATCHER } from './error-matcher.token'; +export * from './error-matcher.token';