Skip to content

AsyncAdapter

Defined in: packages/core/src/adapters/async.ts:55

An adapter designed for asynchronous persistence, such as REST APIs. Includes built-in support for concurrency control (AbortController or Sequential Queue) and error handling.

It is not intended to be subclassed (though you can if you know what you’re doing). Instead, it’s supposed to be instantiated with new AsyncAdapter(options), passing AsyncAdapterOptions for customization.

See documentation for usage guide.

new AsyncAdapter(options): AsyncAdapter

Defined in: packages/core/src/adapters/async.ts:65

AsyncAdapterOptions

AsyncAdapter

BaseAdapter.constructor

read(): Promise<void | AdapterEnvelope<unknown> | null | undefined>

Defined in: packages/core/src/adapters/async.ts:70

Retrieves the current settings and optional metadata from the storage medium.

Promise<void | AdapterEnvelope<unknown> | null | undefined>

An AdapterEnvelope containing config and metadata, or null/undefined/void if empty, depending on adapter implementation.

BaseAdapter.read


write(nextConfig, metadata): Promise<void | AdapterEnvelope<unknown> | null | undefined>

Defined in: packages/core/src/adapters/async.ts:79

Persists changes to the storage medium.

unknown

The full settings object to be saved.

ManagerMetadata

The opaque metadata (e.g. dataVersion) from the Manager.

Promise<void | AdapterEnvelope<unknown> | null | undefined>

The saved envelope (if the backend modifies it), or void/null/undefined.

BaseAdapter.write