CodeMeltedDEV
    Preparing search index...

    Function runtime_available

    • Determines if a particular resources is available to the JavaScript runtime the module was loaded into.

      Parameters

      • params: { name?: string; obj?: object; request: string }

        The named parameters.

        • Optionalname?: string

          An additional name to aid in the query.

        • Optionalobj?: object

          The object to check for a given named feature. Only valid with the AVAILABILITY_REQUEST.AskRuntime request.

        • request: string

          The item to query about the runtime.

      Returns boolean

      // Determine if this is the Worker runtime
      if (runtime_available({request AVAILABILITY_REQUEST.WorkerRuntime})) {
      // Do Worker related things.
      }

      // Ask runtime about a particular thing globally
      // Can also specify the obj property to check on a given object.
      // NOTE: "serial" is predefined ask. Just using as an example.
      if (runtime_available({
      request: AVAILABILITY_REQUEST.AskRuntime,
      name: "serial"})) {
      // Do serial things
      }