@jealous-robot-dev/stan-client
Version:
21 lines (20 loc) • 620 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Publisher = void 0;
var Publisher = /** @class */ (function () {
function Publisher(stan) {
this.stan = stan;
}
Publisher.prototype.publish = function (data) {
var _this = this;
return new Promise(function (resolve, reject) {
_this.stan.publish(_this.subject, JSON.stringify(data), function (err) {
return err
? reject(err)
: resolve();
});
});
};
return Publisher;
}());
exports.Publisher = Publisher;