import * as E from "../../Either"
import * as O from "../../Option"
import { collect_ } from "./collect"
import { scheduleEither_ } from "./scheduleEither"
/**
 * Schedules the output of the stream using the provided `schedule`.
 */

export function schedule_(self, schedule) {
  return collect_(
    scheduleEither_(self, schedule),
    E.fold(
      (_) => O.none,
      (a) => O.some(a)
    )
  )
}
/**
 * Schedules the output of the stream using the provided `schedule`.
 */

export function schedule(schedule) {
  return (self) => schedule_(self, schedule)
}
//# sourceMappingURL=schedule.js.map
