UNPKG

@caidrive/shared

Version:

caidrive.shared.components

43 lines (42 loc) 814 B
"use strict"; /** * What it does. * * @param name - Parameter description. * @returns Type and description of the returned object. * * @example * ``` * Write me later. * ``` */ Object.defineProperty(exports, "__esModule", { value: true }); exports.Publisher = void 0; class Publisher { /** * */ constructor(client) { this.client = client; } /** * */ publish(data) { /** * */ return new Promise((resolve, reject) => { /** * */ this.client.publish(this.channel, JSON.stringify(data), (err) => { if (err) { return reject(err); } resolve(); }); }); } } exports.Publisher = Publisher;