{"id":22494529,"url":"https://github.com/bentatum/redux-status-manager","last_synced_at":"2025-03-27T20:50:07.809Z","repository":{"id":57351668,"uuid":"122860764","full_name":"bentatum/redux-status-manager","owner":"bentatum","description":"success, pending and failure states for a given redux action type","archived":false,"fork":false,"pushed_at":"2018-03-05T13:13:24.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T16:24:30.361Z","etag":null,"topics":["redux","statuses"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/redux-status-manager","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bentatum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-25T17:53:19.000Z","updated_at":"2018-12-05T12:55:27.000Z","dependencies_parsed_at":"2022-09-18T22:40:13.072Z","dependency_job_id":null,"html_url":"https://github.com/bentatum/redux-status-manager","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentatum%2Fredux-status-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentatum%2Fredux-status-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentatum%2Fredux-status-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentatum%2Fredux-status-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bentatum","download_url":"https://codeload.github.com/bentatum/redux-status-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245924498,"owners_count":20694728,"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":["redux","statuses"],"created_at":"2024-12-06T19:14:43.270Z","updated_at":"2025-03-27T20:50:07.786Z","avatar_url":"https://github.com/bentatum.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redux Status Manager\n\n## Installation\nImport reducer and combine with the rest of your reducers.\n\n```js\nimport { combineReducers } from 'redux'\n\nconst reducers = {\n  statuses: require('redux-status-manager').reducer,\n  ...yourOtherReducers\n}\n\nexport default combineReducers(reducers)\n```\n\n## Usage\n\n### dispatching statuses\n\nthis example uses redux-saga.\n\n```js\nimport axios from 'axios'\nimport { put } from 'redux-saga/effects'\nimport { pending, success, failure } from 'redux-status-manager'\nimport { MY_EXAMPLE } from '../actionTypes'\n\nexport default function * ({ payload }) {\n  try {\n    yield put(pending(MY_EXAMPLE))\n\n    // perform asynchronous action(s)...\n\n    yield put(success(MY_EXAMPLE))\n  } catch (err) {\n    yield put(failure(MY_EXAMPLE, err))\n  }\n}\n```\n\n### in a component\n\na common use case might be displaying a progress indicator or an error message based on the status of a given asynchronous action.\n\n```js\nimport React from 'react'\nimport { connect } from 'react-redux'\nimport { Loading, TryAgain, Content } from 'src/components'\nimport { MY_EXAMPLE } from 'src/store/components/example/actionTypes'\n\nconst enhance = connect(state =\u003e ({ status: state.statuses[MY_EXAMPLE] }))\n\nexport default ({ status }) =\u003e\n  \u003cdiv\u003e\n    {status === 'pending' \u0026\u0026 \u003cLoading /\u003e}\n    {status === 'success' \u0026\u0026 \u003cContent /\u003e}\n    {status === 'failure' \u0026\u0026 \u003cTryAgain /\u003e}\n  \u003c/div\u003e\n```\n\n## Tip Jars\n```\nBTC: 33dgdBhV1Yf5ERKLLKS7ztEAEEx3zTvSkw\nETH: 0xa6938ead6d6820377fed78b657e4eb6c5c44d1b3\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentatum%2Fredux-status-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbentatum%2Fredux-status-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentatum%2Fredux-status-manager/lists"}