{"id":17712710,"url":"https://github.com/awibox/react-promise-loader","last_synced_at":"2025-04-15T09:53:31.041Z","repository":{"id":38173730,"uuid":"236146663","full_name":"awibox/react-promise-loader","owner":"awibox","description":"This is NPM package with a component for React that will help you display the loader at use react-promise-tracker","archived":false,"fork":false,"pushed_at":"2025-03-17T10:54:09.000Z","size":1563,"stargazers_count":5,"open_issues_count":14,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T18:23:55.082Z","etag":null,"topics":["loader","loader-component","npm-package","promise-tracker","react-component"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awibox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-25T08:54:53.000Z","updated_at":"2024-12-27T10:55:28.000Z","dependencies_parsed_at":"2024-05-27T18:35:07.150Z","dependency_job_id":"fd2b0aaa-6861-43be-a254-8e32f59f41b4","html_url":"https://github.com/awibox/react-promise-loader","commit_stats":{"total_commits":200,"total_committers":5,"mean_commits":40.0,"dds":0.635,"last_synced_commit":"68cc3108eebc029cd352800fe611a3693e687a92"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":"awibox/react-npm-package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awibox%2Freact-promise-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awibox%2Freact-promise-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awibox%2Freact-promise-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awibox%2Freact-promise-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awibox","download_url":"https://codeload.github.com/awibox/react-promise-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249048714,"owners_count":21204306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["loader","loader-component","npm-package","promise-tracker","react-component"],"created_at":"2024-10-25T09:42:38.871Z","updated_at":"2025-04-15T09:53:31.023Z","avatar_url":"https://github.com/awibox.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![react-promise-loader](https://repository-images.githubusercontent.com/236146663/28c41100-3f90-11ea-9922-a1ed44b60cbe)\n\n[![Version](https://img.shields.io/npm/v/react-promise-loader)](https://www.npmjs.com/package/react-promise-loader)\n[![Build](https://img.shields.io/github/workflow/status/awibox/react-promise-loader/Deploy)](https://github.com/awibox/react-promise-loader/actions)\n[![Coverage](https://coveralls.io/repos/github/awibox/react-promise-loader/badge.svg?branch=master)](https://coveralls.io/github/awibox/react-promise-loader?branch=master)\n[![Minified size](https://img.shields.io/bundlephobia/min/react-promise-loader)](https://github.com/awibox/react-promise-loader/blob/master/LICENSE)\n[![Downloads](https://img.shields.io/npm/dm/react-promise-loader)](https://www.npmjs.com/package/react-promise-loader)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/awibox/react-promise-loader/pulls)\n[![Tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)\n\n\u003c/div\u003e\n\n## Table of contents\n* [Installation](#installation)\n* [Getting started](#gettingstarted)\n* [The settings of the component](#settings)\n* [Contributing](#contributing)\n\n\u003ca name=\"installation\"\u003e\u003c/a\u003e\n## Installation\nYou need to install promise loader and promise tracker packages:\n```bash\nnpm install react-promise-loader react-promise-tracker\n```\nYou can use yarn:\n```bash\nyarn add react-promise-loader react-promise-tracker\n```\n\u003ca name=\"gettingstarted\"\u003e\u003c/a\u003e\n## Getting started\nWrap promises that you would like to track as in the following example:\n```diff\n+ import { trackPromise} from 'react-promise-tracker';\n//...\n\n+ trackPromise(\n    fetchUsers(); // You function that returns a promise\n+ );\n```\nThen you need to add the Loader component and send data from the react-promise-tracker:\n```diff\n+ import { usePromiseTracker } from 'react-promise-tracker';\n+ import Loader from 'react-promise-loader';\n\nconst App = () =\u003e (\n  \u003cdiv className=\"app\"\u003e\n    ...\n+     \u003cLoader promiseTracker={usePromiseTracker} color={'#3d5e61'} background={'rgba(255,255,255,.5)'} /\u003e\n  \u003c/div\u003e\n);\nexport default App;\n```\n\n\u003ca name=\"settings\"\u003e\u003c/a\u003e\n## The settings of the component\n| Parameter          | Type    | Description                                                                           | Default                      |\n|--------------------|---------|---------------------------------------------------------------------------------------|------------------------------|\n| **background**     | string  | Sets the color for the background in any format that supports css                     | ``` rgba(255,255,255,.5) ``` |\n| **color**          | string  | Sets the color of the spinner                                                         | ``` #000 ```                 |\n| **promiseTracker** | boolean | You need to set ```usePromiseTracker``` function from the ```react-promise-tracker``` | ``` false ```                |\n| **loading**        | boolean | If you need to run the loader without tracking promises you should set ```true```     | ``` false ```                |\n| **zIndex**         | number  | You can change the z-index to distribute the layers correctly                         | ``` 999 ```                  |\n\n\u003ca name=\"contributing\"\u003e\u003c/a\u003e\n## Contributing\nPlease read through our [CONTRIBUTING.md](/.github/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawibox%2Freact-promise-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawibox%2Freact-promise-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawibox%2Freact-promise-loader/lists"}