Socket
Socket
Sign inDemoInstall

@nestjs/cqrs

Package Overview
Dependencies
3
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0 to 5.0.1

5

dist/event-bus.d.ts
import { IEventBus, IEvent, IEventHandler } from './interfaces/index';
import { ObservableBus } from './utils/observable-bus';
import { Type } from '@nestjs/common';
import { Observable } from 'rxjs';
import { CommandBus } from './command-bus';

@@ -15,3 +16,3 @@ import { Saga } from './index';

name: string;
}): any;
}): Observable<IEvent>;
bind<T extends IEvent>(handler: IEventHandler<IEvent>, name: string): void;

@@ -21,3 +22,3 @@ combineSagas(sagas: Saga[]): void;

protected registerHandler(handler: EventHandlerMetatype): void;
protected ofEventName(name: string): any;
protected ofEventName(name: string): Observable<IEvent>;
private getEventName(event);

@@ -24,0 +25,0 @@ protected registerSaga(saga: Saga): void;

2

dist/event-bus.js

@@ -56,3 +56,3 @@ "use strict";

ofEventName(name) {
return this.subject$.filter(event => this.getEventName(event) === name);
return this.subject$.pipe(operators_1.filter(event => this.getEventName(event) === name));
}

@@ -59,0 +59,0 @@ getEventName(event) {

import { Subject, Observable } from 'rxjs';
import { EventObservable } from '../interfaces/event-observable.interface';
import { Type } from '@nestjs/common';
export declare class ObservableBus<T> extends Observable<T> implements EventObservable<T> {
protected subject$: Subject<T>;
constructor();
ofType(...metatypes: any[]): Observable<T>;
ofType(...types: Type<any>[]): Observable<T>;
}

@@ -12,6 +12,6 @@ "use strict";

}
ofType(...metatypes) {
return this.pipe(operators_1.filter(event => !isEmpty(metatypes.filter(metatype => event instanceof metatype))));
ofType(...types) {
return this.pipe(operators_1.filter(event => !isEmpty(types.filter(type => event instanceof type))));
}
}
exports.ObservableBus = ObservableBus;
{
"name": "@nestjs/cqrs",
"version": "5.0.0",
"version": "5.0.1",
"description": "A lightweight CQRS module for Nest framework (node.js)",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -62,4 +62,4 @@ import { IEventBus, IEvent, IEventHandler, ICommand } from './interfaces/index';

protected ofEventName(name: string) {
return (this.subject$ as any).filter(
event => this.getEventName(event) === name,
return this.subject$.pipe(
filter(event => this.getEventName(event) === name),
);

@@ -66,0 +66,0 @@ }

import { Subject, Observable } from 'rxjs';
import { EventObservable } from '../interfaces/event-observable.interface';
import { filter } from 'rxjs/operators';
import { Type } from '@nestjs/common';

@@ -16,7 +17,7 @@ const isEmpty = array => !(array && array.length > 0);

ofType(...metatypes): Observable<T> {
ofType(...types: Type<any>[]): Observable<T> {
return this.pipe(
filter(
event =>
!isEmpty(metatypes.filter(metatype => event instanceof metatype)),
!isEmpty(types.filter(type => event instanceof type)),
),

@@ -23,0 +24,0 @@ );

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc