A lightweight library for making cancelable HTTP fetch requests in React Native applications (v0.1.1, no recent updates). It wraps the native fetch API and allows cancellation of in-flight requests using a numeric, string, or object tag. This is useful to prevent memory leaks and state updates on unmounted components. Unlike AbortController (not available in older React Native), it provides a simpler tag-based cancellation mechanism. However, the package has not been updated since 2016 and may have compatibility issues with modern React Native versions.
npm install react-native-cancelable-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates making a cancelable fetch request and aborting it by tag.
Consider using AbortController or a more modern alternative like react-native-abortable-fetch.
Use import cancelableFetch from 'react-native-cancelable-fetch' to avoid name collision.
Ensure the init object matches standard fetch API, but note that some features (like headers) may not work as expected.
Always add a .catch() to handle cancellation errors gracefully.
Use import fetch from 'react-native-cancelable-fetch' instead of const fetch = require('react-native-cancelable-fetch').Ensure the import is correct and the module is loaded before calling abort.
No dependency data recorded yet.