graycoreio/daffodil

View on GitHub
libs/newsletter/driver/src/interfaces/newsletter-service.interface.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Observable } from 'rxjs';

import { createSingletonInjectionToken } from '@daffodil/core';
import { DaffNewsletterSubmission } from '@daffodil/newsletter';

export const {
  token: DaffNewsletterDriver,
  /**
   * Provider function for {@link DaffNewsletterDriver}.
   */
  provider: provideDaffNewsletterDriver,
} = createSingletonInjectionToken<DaffNewsletterServiceInterface<DaffNewsletterSubmission, unknown>>('DaffNewsletterDriver');

export interface DaffNewsletterServiceInterface<T extends DaffNewsletterSubmission, V> {
  send(email: T): Observable<V>;
}