rmapi-js
    Preparing search index...

    Function fetchPlatform

    • a Platform made of fetch, the runtime's sha-256 (node:crypto where there is one, crypto.subtle in a browser), a Store and WebSocket

      A batch goes out a few requests at a time, each retried, answered or failed on its own, and each answer's body hashed as it arrives. A body is read whole to be hashed, and a download is stored only once all of it has arrived. Replace a part with an option; any other method by spreading the result and overriding it. A Client builds one from its own options unless given a whole platform.

      Parameters

      Returns Platform

      RangeError if maxTransientRetries is not an integer from 0, or concurrency or maxBatch one from 1, to 2^32 - 1, or if requestTimeoutMs is below 0 or not a number

      const platform = fetchPlatform({
      store: await IndexedDbStore.open(device.account),
      });
      const client = new Client(device, {
      platform: {
      ...platform,
      upload: (request, source) => {
      console.log("uploading to", request.url);
      return platform.upload(request, source);
      },
      },
      });