Skip to main content

Class: EventWatcher

Defined in: watchers/event.watcher.ts:41

Implements​

  • OnModuleInit
  • OnModuleDestroy

Constructors​

Constructor​

new EventWatcher(collector, nestlensConfig, eventEmitter?): EventWatcher

Defined in: watchers/event.watcher.ts:47

Parameters​

collector​

CollectorService

nestlensConfig​

NestLensConfig

eventEmitter?​

unknown

Returns​

EventWatcher

Methods​

onModuleDestroy()​

onModuleDestroy(): void

Defined in: watchers/event.watcher.ts:85

Stops listening when the module closes.

The emitter belongs to the application and outlives this module, so a listener left on it goes on recording through a collector that is gone — and a process that builds the module more than once against the same emitter, as tests and nest start --hmr do, adds one listener per round and records one entry per listener.

Returns​

void

Implementation of​

OnModuleDestroy.onModuleDestroy


onModuleInit()​

onModuleInit(): void

Defined in: watchers/event.watcher.ts:59

Returns​

void

Implementation of​

OnModuleInit.onModuleInit