// ets_tracing: off
import * as H from "../../../../Hub";
import * as C from "../core";
import * as Ensuring from "./ensuring";
import * as FromHub from "./fromHub";
/**
 * Creates a stream from a subscription to a hub.
 *
 * The hub will be shut down once the stream is closed.
 */

export function fromHubWithShutdown_(hub, maxChunkSize = C.DEFAULT_CHUNK_SIZE) {
  return Ensuring.ensuring_(FromHub.fromHub_(hub, maxChunkSize), H.shutdown(hub));
}
/**
 * Creates a stream from a subscription to a hub.
 *
 * The hub will be shut down once the stream is closed.
 *
 * @ets_data_first fromHubWithShutdown_
 */

export function fromHubWithShutdown(maxChunkSize = C.DEFAULT_CHUNK_SIZE) {
  return hub => fromHubWithShutdown_(hub, maxChunkSize);
}
//# sourceMappingURL=fromHubWithShutdown.js.map