Hyperlinkv0.8.0-beta.28

TxPubSub

TxPubSub.isShutdownconsteffect/TxPubSub.ts:362
<A>(self: TxPubSub<A>): Effect.Effect<boolean>

Checks whether the TxPubSub has been shut down.

Example (Checking whether a pub/sub is shut down)

import { Effect, TxPubSub } from "effect"

const program = Effect.gen(function*() {
  const hub = yield* TxPubSub.unbounded<number>()
  console.log(yield* TxPubSub.isShutdown(hub)) // false
  yield* TxPubSub.shutdown(hub)
  console.log(yield* TxPubSub.isShutdown(hub)) // true
})
getters
export const isShutdown = <A>(self: TxPubSub<A>): Effect.Effect<boolean> => TxRef.get(self.shutdownRef)