@goparrot/pubsub-event-bus
Version:
NestJS EventBus extension for RabbitMQ PubSub
19 lines • 668 B
JavaScript
import { AbstractSubscriptionEvent } from './AbstractSubscriptionEvent';
export class AbstractPubsubEvent extends AbstractSubscriptionEvent {
constructor() {
super(...arguments);
this.options = {};
this.fireLocally = false;
this.getOptions = () => this.options;
this.withOptions = (extra) => {
this.options = { ...this.options, ...extra };
return this;
};
this.localEventEnabled = () => this.fireLocally;
this.withLocalEvent = (allow = true) => {
this.fireLocally = allow;
return this;
};
}
}
//# sourceMappingURL=AbstractPubsubEvent.js.map