@effect-ts/system
Version:
Effect-TS is a zero dependency set of libraries to write highly productive, purely functional TypeScript at scale.
15 lines (12 loc) • 473 B
text/typescript
// ets_tracing: off
import { done as effectDone } from "../Effect/done.js"
import type { Exit } from "../Exit/exit.js"
import { completeWith } from "./completeWith.js"
import type { Promise } from "./promise.js"
/**
* Exits the promise with the specified exit, which will be propagated to all
* fibers waiting on the value of the promise.
*/
export function done<E, A>(e: Exit<E, A>) {
return (promise: Promise<E, A>) => completeWith<E, A>(effectDone(e))(promise)
}