@yepmind/nats-rx-client
Version:
16 lines (11 loc) • 327 B
text/typescript
import { JSONCodec, Msg } from 'nats';
export class NatsEventMessage {
private readonly jsonCodec = JSONCodec();
constructor(private message: Msg) {}
get data(): { cmd: string; payload: any } {
return this.message?.json();
}
get subject(): string {
return this.message?.subject;
}
}