graycoreio/daffodil

View on GitHub
libs/seo/router/src/model/update-event-pair.interface.ts

Summary

Maintainability
A
0 mins
Test Coverage
import {
  ActivatedRoute,
  Event,
} from '@angular/router';

import { Constructable } from '@daffodil/core';

/**
 * Specifies a function to run in response to a particular action.
 * Used to add feature-specific SEO behavior.
 */
export interface DaffSeoUpdateEventPair<T extends Event = Event, V = unknown> {
  /**
   * The type of action to respond to.
   */
  event: Constructable<T>;
  /**
   * A function that gets SEO info from the particular action.
   */
  getData: (event: T, activatedRoute: ActivatedRoute) => V;
}