Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/floydjones1/react-lazy-retry
https://github.com/floydjones1/react-lazy-retry
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/floydjones1/react-lazy-retry
- Owner: floydjones1
- License: mit
- Created: 2021-03-13T17:06:36.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-28T03:32:11.000Z (over 3 years ago)
- Last Synced: 2024-12-15T07:35:53.096Z (about 1 month ago)
- Language: TypeScript
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-lazy-retry
This is a lazyRetry that wraps Reacts lazy loading function.
Implementation below## Geting started
```
// npm
npm intall @tdotcode/react-lazy-retry// yarn
yarn add @tdotcode/react-lazy-retry
```## Usage
1. This will retry 5 times spaced out for 1 second between retries
```javascript
import React from "react";
import lazyRetry from "@tdotcode/react-lazy-retry";
const Greeting = lazyRetry(() => import("./components/Greeting"));function App() {
return (
);
}
```2. You can also control number of retries and duration between retries.
In this example we are retrying 10 times spaced out for 100ms```javascript
import React from "react";
import lazyRetry from "@tdotcode/react-lazy-retry";
const Greeting = lazyRetry(() => import("./components/Greeting"), 10, 100);function App() {
return (
);
}
```