UNPKG

pandora-hub

Version:

pandora.js messenge hub

27 lines 938 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const const_1 = require("../const"); class ConfigClient { static async create(consumerManager) { const configManagerProxy = await consumerManager.getProxy({ name: const_1.PANDORA_HUB_CONFIG_MANAGER }); return new ConfigClient(configManagerProxy); } constructor(configManagerProxy) { this.configManagerProxy = configManagerProxy; } async subscribe(topic, cb) { await this.configManagerProxy.subscribe(topic, cb); const config = await this.configManagerProxy.getConfig(topic); cb(config); } async unsubscribe(topic, cb) { await this.configManagerProxy.unsubscribe(topic, cb); } async getConfig(topic) { return await this.configManagerProxy.getConfig(topic); } } exports.ConfigClient = ConfigClient; //# sourceMappingURL=ConfigClient.js.map