effect-io-ai

Package: effect
Module: Effect

Effect.interrupt

Returns an effect that is immediately interrupted.

Example (Creating an interrupted effect)

import { Effect } from "effect"

const program = Effect.gen(function*() {
  return yield* Effect.interrupt
  yield* Effect.succeed("This won't execute and is unreachable")
})

Effect.runPromise(program).catch(console.error)
// Throws: InterruptedException

Signature

declare const interrupt: Effect<never, never, never>

Source

Since v2.0.0