GitHub

DaffRestoreableMetaService

import { DaffRestoreableMetaService } from '@daffodil/seo'
@Injectable()
class DaffRestoreableMetaService implements DaffSeoRestoreableServiceInterface<DaffSeoMetaDefinition, Record<string, DaffSeoMetaDefinition>> {
  get upsertCache(): Record<string, DaffSeoMetaDefinition>
  get restoreCache(): Record<string, DaffSeoMetaDefinition>
  upsert(def: DaffSeoMetaDefinition): void
  restore(): void
  clear(): void
  emptyRestoreCache(): void
}

Properties

Name Type Description
upsertCache Record<string, DaffSeoMetaDefinition>

Stores the upserted SEO data since the last clear. This represents the SEO data managed by the service.

restoreCache Record<string, DaffSeoMetaDefinition>

Stores the SEO data present on the current document when it is removed by clear. SEO data in this cache can be upserted back into the document with restore.

upsert void

Adds the SEO info to the page. Adds the info to the upsert cache.

restore void

Restores the previously cleared SEO info to the page.

clear void

Removes all of the added SEO info from the page. Only removes what was previously added by this service, that is, what is in the upsert cache.

The SEO data that was removed is then moved to the restore cache.

emptyRestoreCache void

Empties the restore cache. Does not affect upsert cache.