plainfp - v0.1.0
    Preparing search index...

    Function hasTag

    • Runtime tag check that also narrows the type of value to Tagged<Tag>.

      Type Parameters

      • Tag extends string

      Parameters

      • value: unknown
      • tagName: Tag

      Returns value is Readonly<{ _tag: Tag } & Omit<object, "_tag">>

      if (hasTag(state, "Loaded")) {
      // state is Tagged<"Loaded"> here
      render(state)
      }