{"id":19074009,"url":"https://github.com/edtoken/redux-crud-action-types","last_synced_at":"2025-04-28T19:17:02.580Z","repository":{"id":57140579,"uuid":"106210167","full_name":"edtoken/redux-crud-action-types","owner":"edtoken","description":"A simple lib help your define redux action type in easy way","archived":false,"fork":false,"pushed_at":"2018-01-12T16:09:37.000Z","size":49,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-28T19:16:56.631Z","etag":null,"topics":["axios","react","reactjs","reducer","redux","redux-actions"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/redux-crud-action-types","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/edtoken.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":"2017-10-08T21:10:03.000Z","updated_at":"2019-11-06T09:13:24.000Z","dependencies_parsed_at":"2022-09-05T01:30:33.761Z","dependency_job_id":null,"html_url":"https://github.com/edtoken/redux-crud-action-types","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edtoken%2Fredux-crud-action-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edtoken%2Fredux-crud-action-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edtoken%2Fredux-crud-action-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edtoken%2Fredux-crud-action-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edtoken","download_url":"https://codeload.github.com/edtoken/redux-crud-action-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251372532,"owners_count":21578967,"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":["axios","react","reactjs","reducer","redux","redux-actions"],"created_at":"2024-11-09T01:49:24.582Z","updated_at":"2025-04-28T19:17:02.562Z","avatar_url":"https://github.com/edtoken.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redux-crud-action-types\nA simple lib help your define redux action type in easy way.  \nCreate unique names for example:\n```\nexport const USER = create('user') // @crud/pending/id0/user, @crud/success/id0/user, @crud/error/id0/user\nexport const USER_SECOND = create('user') // @crud/pending/id1/user, @crud/success/id1/user, @crud/error/id1/user\n```\n\n[![Build Status](https://api.travis-ci.org/edtoken/redux-crud-action-types.svg?branch=master)](https://travis-ci.org/edtoken/redux-crud-action-types)\n[![npm version](https://badge.fury.io/js/redux-crud-action-types.svg)](https://badge.fury.io/js/redux-crud-action-types)\n[![Maintainability](https://api.codeclimate.com/v1/badges/d795ac0152904aa4c02b/maintainability)](https://codeclimate.com/github/edtoken/redux-crud-action-types/maintainability)\n[![HitCount](http://hits.dwyl.com/edtoken/redux-crud-action-types.svg)](http://hits.dwyl.com/edtoken/redux-crud-action-types)    \n\n[![NPM](https://nodei.co/npm/redux-crud-action-types.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/redux-crud-action-types/)        \n[![NPM](https://nodei.co/npm-dl/redux-crud-action-types.png?height=3)](https://nodei.co/npm/redux-crud-action-types/)  \n\n\n## Install\n```\nnpm install redux-crud-action-types --save\n```\n\n## Usage\n\n### Action types before\n```\n// actionTypes.js\nexport const USER_PENDING = 'USER_PENDING'\nexport const USER_SUCCESS = 'USER_SUCCESS'\nexport const USER_ERROR = 'USER_ERROR'\n\n```\n\n### Action types after\n```\n// actionTypes.js\n\nimport {create} from 'redux-crud-action-types'\n\nexport const USER = create('USER')\n\n```\n\n\n### Reducer before\n```\n//reducer.js \n\nimport { USER_ERROR, USER_PENDING, USER_SUCCESS } from './actionTypes'\n\nexport const reducer = (state, action) =\u003e {\n  switch (action.type) {\n    case USER_PENDING:\n      //\n      break\n    case USER_SUCCESS:\n      //\n      break\n    case USER_ERROR:\n      //\n      break\n  }\n  return state\n}\n```\n\n### Reducer after\nabout case `USER` see [LINK](https://github.com/edtoken/redux-crud-action-types/blob/master/test/redux-crud-action-types.spec.js#L70) and [LINK](https://github.com/edtoken/redux-crud-action-types/blob/master/src/redux-crud-action-types.js#L21)\n \n```\n//reducer.js \n\nimport { USER } from './actionTypes'\n\nexport const reducer = (state, action) =\u003e {\n  switch (action.type) {\n    case USER: // or case USER.PENDING\n      //\n      break\n    case USER.SUCCESS:\n      //\n      break\n    case USER.ERROR:\n      //\n      break\n  }\n  return state\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedtoken%2Fredux-crud-action-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedtoken%2Fredux-crud-action-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedtoken%2Fredux-crud-action-types/lists"}