Options
All
  • Public
  • Public/Protected
  • All
Menu

The RewritingFetcher is a fairly thin layer around the native fetch method, allowing asynchronous manipulation of the request before it is sent. The primary motivation is adding authorization headers, likely based on a refresh token, but the rewriter can in principle manipulate the request in any way.

Hierarchy

Index

Constructors

constructor

Properties

Static Readonly inflightReads

inflightReads: BehaviorSubject<number> = ...

Static Readonly inflightWrites

inflightWrites: BehaviorSubject<number> = ...

Methods

fetch

  • fetch(url: string, requestInit?: RequestInit): Observable<Response>
  • fetch(request: SimpleRequest): Observable<Response>
  • Parameters

    • url: string
    • Optional requestInit: RequestInit

    Returns Observable<Response>

  • Parameters

    Returns Observable<Response>

setRequestRewriter

  • A RequestRewriter must be set (even if just the do-nothing ANONYMOUS rewriter) before a server can be contacted. (The Fetcher cannot make assumptions and default to an anonymous access attempt, since we do not want to spam requests to a server which requires login before the login rewriter is ready).

    Parameters

    Returns RewritingFetcher