kafka-ts
Version:
**KafkaTS** is a Apache Kafka client library for Node.js. It provides both a low-level API for communicating directly with the Apache Kafka cluster and high-level APIs for publishing and subscribing to Kafka topics.
17 lines (16 loc) • 377 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.shared = void 0;
const shared = (func) => {
let promise;
return () => {
if (!promise) {
promise = func();
promise.finally(() => {
promise = undefined;
});
}
return promise;
};
};
exports.shared = shared;