UNPKG

expeditavoluptas

Version:

TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.

22 lines (15 loc) 592 B
import type { EventSubscriber, FlushEventArgs } from '@mikro-orm/core'; import { Subscriber } from '@mikro-orm/core'; @Subscriber() export class FlushSubscriber implements EventSubscriber { static readonly log: [string, FlushEventArgs][] = []; async beforeFlush(args: FlushEventArgs): Promise<void> { FlushSubscriber.log.push(['beforeFlush', args]); } async onFlush(args: FlushEventArgs): Promise<void> { FlushSubscriber.log.push(['onFlush', args]); } async afterFlush(args: FlushEventArgs): Promise<void> { FlushSubscriber.log.push(['afterFlush', args]); } }