Skip to content
From 0.5.0 the packages continue as @cqrs-ddd, documented at aristoteliss.github.io/ddd-cqrs; NestJS applications add @cqrs-ddd/nestjs. This site documents the 0.4.x line.

createCacheMutationBarrier

createCacheMutationBarrier(reason, entity?): CacheMutationBarrier

Defined in: packages/ddd-core/persistence/helpers/cache-barrier.helper.ts:67

Factory creating a new CacheMutationBarrier with a unique token.

CacheBarrierReason

Whether the barrier represents an entity deletion or secondary invalidation.

unknown

Optional entity or snapshot providing diagnostic id or version metadata.

CacheMutationBarrier

Pure serializable CacheMutationBarrier.

const barrier = createCacheMutationBarrier('deleted', user);
await cache.set(key, barrier, { ttl: DEFAULT_BARRIER_TTL_MS });