Headers type
Params type
State type
ReadonlyconfigOptions store for accessing all configuration.
Single source of truth for ALL configuration. Supports deep
path access via get('retry.maxAttempts') and runtime updates
via set('baseUrl', newUrl).
Fully typed with FetchEngine.Options<H, P, S>.
ReadonlyheaderProperty store for headers.
Manages default headers, method-specific headers, and resolution.
ReadonlyhooksHook engine for the request lifecycle pipeline.
Plugins register beforeRequest/afterRequest hooks here. The executor runs these hooks around each request.
ReadonlyparamProperty store for URL parameters.
Manages default params, method-specific params, and resolution.
ReadonlystateState store for managing instance state.
Provides get/set/reset operations with event emission.
Returns if the observable instance has the given event
The internals of the observable instance.
NOTE: Do not use this to try to meddle with the internals of the observable instance. This is for debugging purposes only.
Enables or disables debugging for the observable instance. Works in conjunction with your spy function. Provides a stack trace of events that are triggered, listened to, and cleaned up.
Optionalon: booleanWhether to enable or disable debugging
Returns an event generator that will listen for the specified event
Optionaloptions: ListenerOptionsReturns an event generator that will listen for the specified event
Optionaloptions: ListenerOptionsListens for the specified event and executes the given callback
Optionaloptions: ListenerOptionsReturns an event generator that will listen for the specified event
Optionaloptions: ListenerOptionsReturns an event generator that will listen for all events matching the regex
Optionaloptions: ListenerOptionsListens for all events matching the regex and executes the given callback
Optionaloptions: ListenerOptionsReturns an event promise that resolves when the specified event is emitted. This overload is untyped and can be used to listen for any event that is emitted.
Optionaloptions: ListenerOptionsExecutes a callback once when the specified event is emitted. This overload is untyped and can be used to listen for any event that is emitted.
Optionaloptions: ListenerOptionsReturns an event promise that resolves when any events matching the regex are emitted
Optionaloptions: ListenerOptionsExecutes a callback once when any events matching the regex are emitted
Optionaloptions: ListenerOptions
Core interface that FetchEngine implements.
This interface defines what internal components (RequestExecutor, policies, stores) can access from the engine. All configuration is accessed through stores, and events are emitted through the ObserverEngine base.
FetchEngineCore extends ObserverEngine which provides type-safe
event emission. This is the ONLY way for internal components to emit events,
guaranteeing type safety at emit time.
Example