Registry / devops / redux-api-call-adapter-fetch

redux-api-call-adapter-fetch

JSON →
library1.1.1jsnpmunverified

A fetch-based adapter for redux-api-call that enables making API requests via the HTML5 Fetch API. Current stable version is 1.1.1, with low release cadence. Provides a lightweight alternative to other adapters (e.g., axios) by leveraging native fetch. Requires redux-api-call as a peer dependency. Primarily used in Redux-based React apps where fetching via fetch is preferred.

npm install redux-api-call-adapter-fetch
INSTALL
IMPORT
SIG · REDUX-API-CALL-ADA
R
redux-api-call-adapter-fetch
devopsjavascriptv1.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import adapter from 'redux-api-call-adapter-fetch'
const adapter = require('redux-api-call-adapter-fetch')
Package exports a default function that returns a fetch adapter for redux-api-call.
adapter
import fetchAdapter from 'redux-api-call-adapter-fetch'
import { fetchAdapter } from 'redux-api-call-adapter-fetch'
Default export is the adapter; named import does not exist.
redux-api-call's createApiCall
import { createApiCall } from 'redux-api-call'; import adapter from 'redux-api-call-adapter-fetch'; const api = createApiCall(adapter);
import { createApiCall } from 'redux-api-call-adapter-fetch'
The adapter is a separate package; do not combine imports.

Shows how to create an API call instance using the fetch adapter and make a GET request.

import { createApiCall } from 'redux-api-call'; import adapter from 'redux-api-call-adapter-fetch'; const api = createApiCall(adapter); async function fetchData() { try { const response = await api('/api/data', { method: 'GET' }); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } }
Debug
Known issues
gotchaThe adapter's default export is a function that requires arguments (like baseUrl or headers) for configuration.
fix
Call adapter as a function: const adapterInstance = adapter({ baseUrl: 'https://api.example.com' });
affects: >=1.0.0
deprecatedPackage has low maintenance; no updates since 2019.
fix
Consider using a maintained alternative like redux-api-call's axios adapter or RTK Query.
affects: >=1.0.0
gotchaThe adapter expects fetch to be globally available; may not work in older Node versions without polyfill.
fix
Install 'node-fetch' and set global.fetch = require('node-fetch') in Node <18.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: adapter is not a function
Importing the default export incorrectly (e.g., named import instead of default).
fix
Use 'import adapter from 'redux-api-call-adapter-fetch'' or 'const adapter = require('redux-api-call-adapter-fetch').default'
Error: Cannot find module 'redux-api-call'
Missing peer dependency redux-api-call.
fix
Install redux-api-call: npm install redux-api-call
TypeError: fetch is not defined
Fetch API not available in the environment (e.g., Node.js without polyfill).
fix
Install node-fetch and set global.fetch = require('node-fetch'); or use Node 18+.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
redux-api-callrequiredpeer dependency: this is an adapter for redux-api-call
Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
redux-api-call-adapter-fetch — npm install redux-api-call-adapter-fetch · libregistry