@Module({})
export class VendorModule implements OnModuleInit {
private pulse: typeof pulseType;
constructor(@Inject('PRISMA') private prisma: PrismaClient) {}
async onModuleInit() {
this.pulse = this.prisma.$extends(
withPulse({
apiKey: process.env.PULSE_API_KEY,
}),
);
await this.setupListeners();
}
private async setupListeners() {
this.pulse.user.stream(/*...*/);
}
}
@Module({})
export class VendorModule implements OnModuleInit {
private pulse: typeof pulseType;
constructor(@Inject('PRISMA') private prisma: PrismaClient) {}
async onModuleInit() {
this.pulse = this.prisma.$extends(
withPulse({
apiKey: process.env.PULSE_API_KEY,
}),
);
await this.setupListeners();
}
private async setupListeners() {
this.pulse.user.stream(/*...*/);
}
}