graycoreio/daffodil

View on GitHub
libs/reviews/state/src/reducers/injection-tokens/config.token.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { inject } from '@angular/core';
import { StoreConfig } from '@ngrx/store';

// workaround https://github.com/graycoreio/daffodil/issues/1667
import { createSingleInjectionToken } from '@daffodil/core';
import { DaffProductReview } from '@daffodil/reviews';

import { DAFF_REVIEWS_META_REDUCERS } from './meta.token';
import { DaffReviewsReducersState } from '../reducers-state.interface';

export const {
  /**
   * An internal token to hold the Daffodil product feature store config.
   *
   * @docs-private
   */
  token: DAFF_REVIEWS_STORE_CONFIG,
  /**
   * Provider function for {@link DAFF_REVIEWS_STORE_CONFIG}.
   */
  provider: provideDaffReviewsStoreConfig,
} = createSingleInjectionToken<StoreConfig<DaffReviewsReducersState>>(
  'DAFF_REVIEWS_STORE_CONFIG',
  {
    factory: () => ({
      metaReducers: inject(DAFF_REVIEWS_META_REDUCERS),
    }),
  },
);