publisher-subscriber-ts
Version:
Publisher subscriber library for javascript
30 lines (29 loc) • 745 B
TypeScript
/**
* @author Harsh A. Mistry
*
* Subscriber class to start listening to any topic
*/
export declare class Subscriber {
private _callBack;
private _id;
private _topicName;
constructor(callBack: (...args: any[]) => void, topicName: string);
/**
* Getter for callback
*
* @returns {Function} callback function provided while subscribing
*/
get callBack(): (...args: any[]) => void;
/**
* Getter for subscrber ID. Used for unsubscription.
*
* @returns {string} subscription ID
*/
get id(): string;
/**
* Getter for topic name. Used for unsubscription.
*
* @returns {string} topic name
*/
get topicName(): string;
}