add Stream halt()

This commit is contained in:
Nikita Volodin
2020-09-07 16:09:34 +01:00
committed by Michael Arnaldi
parent af4acff4da
commit 04dcafe0b3
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
import type { Cause } from "../../Cause"
import { halt as haltEff } from "../../Effect/core"
import { flow } from "../../Function"
import type { SyncE } from "./definitions"
import { fromEffect } from "./fromEffect"
/**
* The stream that always halts with `cause`.
*/
export const halt: <E>(cause: Cause<E>) => SyncE<E, never> = flow(haltEff, fromEffect)
@@ -37,6 +37,7 @@ export * from "./fromEffectOption"
export * from "./fromQueue"
export * from "./fromQueueWithShutdown"
export * from "./fromSchedule"
export * from "./halt"
export * from "./iterate"
export * from "./managed"
export * from "./map"