@dudousxd/nestjs-telescope
Version:
Laravel Telescope-style observability console for NestJS — core: watchers, recorder, correlation, SQLite store, headless API.
35 lines • 1.43 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Injectable } from '@nestjs/common';
import { Subject } from 'rxjs';
/**
* Process-local bus of "entries of these types were just persisted". Fed from the
* recorder's onFlushStored hook; consumed by the SSE stream to push invalidation
* ticks. Stateless and best-effort — never throws into the flush path.
*/
let EntryEvents = class EntryEvents {
subject = new Subject();
emitTypes(types) {
const unique = [...new Set(types)];
if (unique.length === 0)
return;
try {
this.subject.next(unique);
}
catch {
// observability must never break the flush
}
}
stream() {
return this.subject.asObservable();
}
};
EntryEvents = __decorate([
Injectable()
], EntryEvents);
export { EntryEvents };
//# sourceMappingURL=entry-events.js.map