MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / Interceptors

Class Interceptors

frontend/src/client/core/OpenAPI.ts:8–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6type Resolver<T> = (options: ApiRequestOptions<T>) => Promise<T>
7
8export class Interceptors<T> {
9 _fns: Middleware<T>[]
10
11 constructor() {
12 this._fns = []
13 }
14
15 eject(fn: Middleware<T>): void {
16 const index = this._fns.indexOf(fn)
17 if (index !== -1) {
18 this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]
19 }
20 }
21
22 use(fn: Middleware<T>): void {
23 this._fns = [...this._fns, fn]
24 }
25}
26
27export type OpenAPIConfig = {
28 BASE: string

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected