Socket
Book a DemoInstallSign in
Socket

react-native-retriable-fetch

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-retriable-fetch

Quick and dirty wrapper around fetch API to allow retries

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
5
25%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-retriable-fetch

Quick and dirty wrapper around fetch API to allow retries

Package version Downloads Standard Travis Build Standard Readme GitHub version Dependency CI License PRs Donate


Built with ❤︎ by Tiaan and contributors

Table of Contents

Table of Contents
  • Install
  • Usage
  • Contribute
  • License
  • Install

    $ npm install --save react-native-retriable-fetch
    # OR
    $ yarn add react-native-retriable-fetch
    

    Usage

    Use like you would normally use the fetch API. This module adds additional options:

    • retries (default: 1, Optional) - Number of retries to perform
    • delay: (default: undefined, Optional) - Delay between retry attempts
    • rejectCodes: (default: [], Optional) - Array of response status codes to trigger a retry
    // ... Other imports
    
    import fetch from 'react-native-retriable-fetch'
    
    export default class Example extends Component {
    
      componentDidMount () {
    		// Use like you would fetch
        fetch('foobarbaz', {retries: 5, delay:2000, rejectCodes: [404]})
      }
    
    	render() {
    		return (
    			// lalala
    		)
    	}
    }
    

    Contribute

    Contributions are welcome. Please open up an issue or create PR if you would like to help out.

    Note: If editing the README, please conform to the standard-readme specification.

    License

    Licensed under the MIT License.

    Keywords

    react-native

    FAQs

    Package last updated on 27 Apr 2017

    Did you know?

    Socket

    Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

    Install

    Related posts