Skip to main content
Version: 0.1.2

Function: setFetchStateAdapter()

Imported from @react-logic/utils

setFetchStateAdapter(adapter): void

Replace the global FetchAdapter used by every fetchState call that doesn't pass its own fetcher override. Call once at app boot — e.g. to route every reactive fetch through axios:

import axios from 'axios';
import { setFetchStateAdapter, createAxiosFetchAdapter } from '@react-logic/utils';

setFetchStateAdapter(createAxiosFetchAdapter(axios));

Parameters

adapter

FetchAdapter

The new global adapter.

Returns

void