graycoreio/daffodil

View on GitHub
libs/cart/driver/magento/src/injection-tokens/cart-mutation-queue.token.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { inject } from '@angular/core';
import { Apollo } from 'apollo-angular';

import { createSingleInjectionToken } from '@daffodil/core';
import { DaffQueuedApollo } from '@daffodil/core/graphql';

export const {
  token: DAFF_MAGENTO_CART_MUTATION_QUEUE,
  /**
   * Provider function for {@link DAFF_MAGENTO_CART_MUTATION_QUEUE}.
   */
  provider: provideDaffCartMagentoMutationQueue,
} = createSingleInjectionToken<DaffQueuedApollo>(
  'DAFF_MAGENTO_CART_MUTATION_QUEUE', {
    providedIn: 'root',
    factory: () => new DaffQueuedApollo(inject(Apollo)),
  },
);