Setu-TS
    Preparing search index...

    Function createObservedFetch

    • Wraps a fetch so its attempts are counted for the local diagnostics connector (M98n).

      Calling this IS the opt-in: build the helper only when a devtool composition is present, and register plugin in that application. The wrapper records that an attempt started, whether it resolved or failed, the response's status class and its time to headers — nothing else. It never reads the URL, headers, body, signal or error.

      Deliberate departure: a wrapped fetch that throws SYNCHRONOUSLY is rethrown synchronously, although the return type is a promise — the wrapper must not change the behavior of the application code it wraps.

      Parameters

      Returns ObservedFetch

      The observed fetch and its registration plugin

      For malformed options, a failing clock probe, or no crypto.getRandomValues — each with a fixed message naming no value

      For an alias outside 1–64 UTF-8 bytes or carrying a control character

      const observed = createObservedFetch({ alias: 'payments-api' });
      const client = createClient({ baseUrl: 'https://payments.example', fetch: observed.fetch });

      0.8.0