{"id":21707217,"url":"https://github.com/revathskumar/redux-blackbox","last_synced_at":"2026-04-17T01:04:27.486Z","repository":{"id":42211543,"uuid":"177254223","full_name":"revathskumar/redux-blackbox","owner":"revathskumar","description":"Reduce redux boilerplate by following conventions \u0026 creating reducer on the fly","archived":false,"fork":false,"pushed_at":"2023-03-04T03:27:01.000Z","size":116,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-25T16:10:00.392Z","etag":null,"topics":["redux"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/redux-blackbox","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/revathskumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-23T06:42:37.000Z","updated_at":"2023-03-04T11:47:49.000Z","dependencies_parsed_at":"2023-02-02T21:00:50.483Z","dependency_job_id":null,"html_url":"https://github.com/revathskumar/redux-blackbox","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revathskumar%2Fredux-blackbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revathskumar%2Fredux-blackbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revathskumar%2Fredux-blackbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revathskumar%2Fredux-blackbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/revathskumar","download_url":"https://codeload.github.com/revathskumar/redux-blackbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244656734,"owners_count":20488641,"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"],"created_at":"2024-11-25T22:16:14.901Z","updated_at":"2026-04-17T01:04:22.455Z","avatar_url":"https://github.com/revathskumar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"redux-blackbox\n==============\n\n\u003e Reduce redux boilerplate by following conventions\n\n## How to use\n\n#### setup reducer\n\n```js\n// reducer/index.js\n\nimport { createReducer } from \"redux-blackbox\";\n\n\nexport default {\n  users: createReducer(\"users\")\n}\n```\n\n#### setup actions\n\n```js\n// actions/users.js\nimport { fetchListingAction } from \"redux-blackbox\";\n\nconst fetchUsers = () =\u003e {\n  return axios.get(\"/users\");\n}\n\nexport const fetchUsersAction = () =\u003e {\n  return async (dispatch) =\u003e{\n    return await fetchListingAction(\"users\", dispatch, fetchUsers);\n  }\n}\n```\n\n#### setup component\n\n```jsx\n// components/ListUsers.js\nimport { IN_PROGRESS, FAILED, SUCCESS } from \"redux-blackbox\";\n\n\nclass ListUsers extends React.Component {\n  componentDidMount() {\n    this.props.fetchUsersAction();\n  }\n  render() {\n    const {users} = this.props;\n    if (users.uiState === IN_PROGRESS) {\n      return \u003cdiv\u003eLoading...\u003c/div\u003e\n    }\n    if (users.uiState === FAILED) {\n      return \u003cdiv className=\"notification is-danger\"\u003e{users.error.message}\u003c/div\u003e\n    }\n    if (users.uiState === SUCCESS) {\n      if (users.listing.length) {\n        return (\n          \u003cdiv\u003e\n            \u003cul\u003e\n              { users.listing.map(user =\u003e{\n                  return \u003cli\u003e{user.name}\u003c/li\u003e\n                }) \n              }\n            \u003c/ul\u003e\n          \u003c/div\u003e\n        )\n      } else {\n        return \u003cdiv\u003eUsers list is empty\u003c/div\u003e\n      }\n    }\n    return null;\n  }\n}\n\nconst mapStateToProps = (state) =\u003e{\n  return {\n    users: state.users\n  }\n}\n\nconst mapDispatchToProps = {\n  fetchUsersAction\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ListUsers);\n```\n\nLicense\n-------\nPlease see [License](https://github.com/revathskumar/redux-blackbox/blob/master/License)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevathskumar%2Fredux-blackbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevathskumar%2Fredux-blackbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevathskumar%2Fredux-blackbox/lists"}