import * as tsplus_module_1 from "@effect/core/stream/Stream/operations/fromChunkQueue";
import * as tsplus_module_2 from "@effect/core/stream/Stream/operations/scoped";
import * as tsplus_module_3 from "@effect/core/stream/Stream/operations/flatMap";
/**
 * Creates a stream from a subscription to a `Hub`.
 *
 * @tsplus static ets/Stream/Ops fromChunkHub
 */

export function fromChunkHub(hub, __tsplusTrace) {
  return tsplus_module_3.flatMap_(tsplus_module_2.scoped(() => hub().subscribe, __tsplusTrace), queue => tsplus_module_1.fromChunkQueue(() => queue, __tsplusTrace), __tsplusTrace);
}
//# sourceMappingURL=fromChunkHub.mjs.map