registerHttpAdapter static method

void registerHttpAdapter(
  1. TelescopeHttpAdapter adapter
)

Register a pluggable HTTP capture adapter (Dio, package:http, Chopper, Magic's Http facade). The adapter's install() is called immediately.

Also pushes the adapter onto the library-internal httpAdapterRegistry so TelescopeStore.pendingHttpCount can sum TelescopeHttpAdapter.pendingCount across every registered adapter without taking a new public API on TelescopeStore.

Implementation

static void registerHttpAdapter(TelescopeHttpAdapter adapter) {
  _httpAdapters.add(adapter);
  httpAdapterRegistry.add(adapter);
  adapter.install();
}