Skip to content

Docs: document that ReactiveFetchManager requires registerGlobally() to patch global fetch #7

@jeswr

Description

@jeswr

Summary

The README has no API documentation for ReactiveFetchManager, and the patching model is easy to get wrong. In the published 0.1.3, constructing the manager does not patch globalThis.fetch — you must call registerGlobally():

const manager = new ReactiveFetchManager([provider]);
manager.registerGlobally(); // <-- without this, globalThis.fetch is never patched

Without registerGlobally(), plain fetch() (and libraries built on it, e.g. @jeswr/fetch-rdf) never upgrade on 401, so authenticated requests silently fail and the login popup never opens. This is a non-obvious trap when building against the published package.

Request

A short README/API note stating that registerGlobally() is required to install the global fetch patch (and that the constructor alone does not), ideally with the two-line snippet above.

Context

This bit us while building a Solid app; we corrected the downstream guide that had wrongly stated construction patches fetch:
jeswr/solid-ai-coding@ad05301

Happy to open a small README PR if that's welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions