UNPKG

@effect-ts/system

Version:

Effect-TS is a zero dependency set of libraries to write highly productive, purely functional TypeScript at scale.

20 lines (17 loc) 507 B
// ets_tracing: off import { succeedWith, suspend } from "./core.js" import { effectAsyncInterrupt } from "./effectAsyncInterrupt.js" /** * Returns a effect that will never produce anything. The moral equivalent of * `while(true) {}`, only without the wasted CPU cycles. */ export const never = suspend(() => effectAsyncInterrupt<unknown, never, never>(() => { const interval = setInterval(() => { // }, 60000) return succeedWith(() => { clearInterval(interval) }) }) )