Skip to content

Latest commit

 

History

History
75 lines (49 loc) · 2.91 KB

stellate-service.md

File metadata and controls

75 lines (49 loc) · 2.91 KB
title isDefaultIndex generated
StellateService
false
true

import MemberInfo from '@site/src/components/MemberInfo'; import GenerationInfo from '@site/src/components/GenerationInfo'; import MemberDescription from '@site/src/components/MemberDescription';

StellateService

The StellateService is used to purge the Stellate cache when certain events occur.

class StellateService {
    constructor(options: StellatePluginOptions)
    purgeProducts(products: Product[]) => ;
    purgeProductVariants(productVariants: ProductVariant[]) => ;
    purgeSearchResults(items: Array<ProductVariant | Product>) => ;
    purgeAllOfType(type: CachedType) => ;
    purgeCollections(collections: Collection[]) => ;
    purgeSearchResponseCacheIdentifiers(collections: Collection[]) => ;
    purge(type: CachedType, keys?: ID[], keyName:  = 'id') => ;
}

constructor

<MemberInfo kind="method" type={(options: <a href='/reference/core-plugins/stellate-plugin/stellate-plugin-options#stellatepluginoptions'>StellatePluginOptions</a>) => StellateService} />

purgeProducts

<MemberInfo kind="method" type={(products: <a href='/reference/typescript-api/entities/product#product'>Product</a>[]) => } />

Purges the cache for the given Products.

purgeProductVariants

<MemberInfo kind="method" type={(productVariants: <a href='/reference/typescript-api/entities/product-variant#productvariant'>ProductVariant</a>[]) => } />

Purges the cache for the given ProductVariants.

purgeSearchResults

<MemberInfo kind="method" type={(items: Array&#60;<a href='/reference/typescript-api/entities/product-variant#productvariant'>ProductVariant</a> | <a href='/reference/typescript-api/entities/product#product'>Product</a>&#62;) => } />

Purges the cache for SearchResults which contain the given Products or ProductVariants.

purgeAllOfType

<MemberInfo kind="method" type={(type: CachedType) => } />

Purges the entire cache for the given type.

purgeCollections

<MemberInfo kind="method" type={(collections: <a href='/reference/typescript-api/entities/collection#collection'>Collection</a>[]) => } />

Purges the cache for the given Collections.

purgeSearchResponseCacheIdentifiers

<MemberInfo kind="method" type={(collections: <a href='/reference/typescript-api/entities/collection#collection'>Collection</a>[]) => } />

Purges the cache of SearchResults for the given Collections based on slug.

purge

<MemberInfo kind="method" type={(type: CachedType, keys?: <a href='/reference/typescript-api/common/id#id'>ID</a>[], keyName: = 'id') => } />

Purges the cache for the given type and keys.