ing
This commit is contained in:
parent
13f2c6d089
commit
73d4672cbb
|
@ -32,11 +32,13 @@ export interface SubscriberMethod {
|
|||
|
||||
@Injectable()
|
||||
export class RPCSubscribeService {
|
||||
private subscriberTypes: Set<Type<any>>;
|
||||
private subscribers: Set<any>;
|
||||
private subscriberMethodMap: Map<string, SubscriberMethod[]>;
|
||||
|
||||
constructor(
|
||||
) {
|
||||
this.subscriberTypes = new Set();
|
||||
this.subscribers = new Set();
|
||||
this.subscriberMethodMap = new Map();
|
||||
}
|
||||
|
@ -44,12 +46,12 @@ export class RPCSubscribeService {
|
|||
public addSubscriber(subscriber: Type<any>): void {
|
||||
const type = TypeUtil.getType(subscriber);
|
||||
|
||||
if (this.subscribers.has(subscriber)) {
|
||||
if (this.subscriberTypes.has(type)) {
|
||||
console.log(`Subscriber[${type.name}] has been added`);
|
||||
return;
|
||||
}
|
||||
|
||||
this.subscribers.add(subscriber);
|
||||
this.subscriberTypes.add(type);
|
||||
|
||||
const clazz = Class.forType(type);
|
||||
if (undefined === clazz) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user