Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "discourse/parseValue"

Index

Functions

Functions

parseValue

  • parseValue<DataImmutable, DataMutable>(value: External<DataImmutable>, factory: function): Internal<DataMutable>
  • Invoked when literal JSON needs to be parsed into the internal representation. When variables are used, they can be defined as pure JSON. This function parses that JSON into the concrete discourses for internal use.

    query ($discourse: ConversationDiscourse!) {
      update(discourse: $discourse) {
        dom
      }
    }
    {
      "type": "direct",
      "id": "d5be6f95-d521-4576-b27f-f662d7fd9dec"
    }
    throws

    { TypeError } the incoming data was invalid

    Type parameters

    • DataImmutable

    • DataMutable: DataImmutable

    Parameters

    • value: External<DataImmutable>

      the parsed variable value

    • factory: function
        • (data: DataImmutable): DataMutable
        • Parameters

          • data: DataImmutable

          Returns DataMutable

    Returns Internal<DataMutable>

    a concrete Discourse class