"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.concatMapWithCustom = void 0;
exports.concatMapWithCustom_ = concatMapWithCustom_;

var _primitives = /*#__PURE__*/require("@effect/core/stream/Channel/definition/primitives");

/**
 * Returns a new channel whose outputs are fed to the specified factory
 * function, which creates new channels in response. These new channels are
 * sequentially concatenated together, and all their outputs appear as outputs
 * of the newly returned channel. The provided merging function is used to
 * merge the terminal values of all channels into the single terminal value of
 * the returned channel.
 *
 * @tsplus fluent ets/Channel concatMapWithCustom
 */
function concatMapWithCustom_(self, f, g, h, onPull, onEmit) {
  return new _primitives.ConcatAll(g, h, onPull, onEmit, () => self, f);
}
/**
 * Returns a new channel whose outputs are fed to the specified factory
 * function, which creates new channels in response. These new channels are
 * sequentially concatenated together, and all their outputs appear as outputs
 * of the newly returned channel. The provided merging function is used to
 * merge the terminal values of all channels into the single terminal value of
 * the returned channel.
 *
 * @tsplus static ets/Channel/Aspects concatMapWithCustom
 */


const concatMapWithCustom = (f, g, h, onPull, onEmit) => self => concatMapWithCustom_(self, f, g, h, onPull, onEmit);

exports.concatMapWithCustom = concatMapWithCustom;
//# sourceMappingURL=concatMapWithCustom.js.map