Arize Phoenix TS
    Preparing search index...
    • Type guard to check if a value is the CLOSED symbol

      Type Parameters

      • T

      Parameters

      • value: typeof CLOSED | T

        Value to check

      Returns value is typeof CLOSED

      true if value is CLOSED symbol

      const value = await ch.receive();
      if (isClosed(value)) {
      console.log("Channel is closed");
      } else {
      console.log("Got value:", value);
      }