PurgeRule
Defines a rule that listens for a particular VendureEvent and uses that to make calls to the Stellate Purging API via the provided StellateService instance.
eventType
property
Type<Event>bufferTimeMs
property
number | undefinedhandle
method
(handlerArgs: { events: Event[]; stellateService: StellateService; injector: Injector }) => constructor
method
(config: PurgeRuleConfig<Event>) => PurgeRuleConfigures a PurgeRule.
eventType
property
Type<Event>Specifies which VendureEvent will trigger this purge rule.
bufferTime
property
numberDefault:
5000How long to buffer events for in milliseconds before executing the handler. This allows us to efficiently batch calls to the Stellate Purge API.
handler
property
(handlerArgs: { events: Event[]; stellateService: StellateService; injector: Injector; }) => void | Promise<void>The function to invoke when the specified event is published. This function should use the StellateService instance to call the Stellate Purge API.
Was this chapter helpful?