import * as tsplus_module_1 from "@effect/core/stream/Channel/operations/write";
import * as tsplus_module_2 from "@effect/core/stream/Channel/operations/doneCollect";
import * as tsplus_module_3 from "@effect/core/stream/Channel/operations/flatMap";
/**
 * Returns a new channel that collects the output and terminal value of this
 * channel, which it then writes as output of the returned channel.
 *
 * @tsplus getter ets/Channel emitCollect
 */

export function emitCollect(self) {
  return tsplus_module_3.flatMap_(tsplus_module_2.doneCollect(self), t => tsplus_module_1.write(() => t));
}
//# sourceMappingURL=emitCollect.mjs.map