# redux-crud-action-types

> A simple lib help your define redux action type in easy way

Latest version **1.0.6** (published 2017-10-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-crud-action-types
pnpm add redux-crud-action-types
yarn add redux-crud-action-types
bun add redux-crud-action-types
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2017-10-12 |
| First published | 2017-10-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Eduard Titov |
| Maintainers | edtoken |
| Keywords | redux, react, crud, redux-crud, redux-ajax, ajax |

## Links

- npm: https://www.npmjs.com/package/redux-crud-action-types
- Repository: https://github.com/edtoken/redux-crud-action-types
- Homepage: https://github.com/edtoken/redux-crud-action-types#readme
- Issues: https://github.com/edtoken/redux-crud-action-types/issues
- npm.io page: https://npm.io/package/redux-crud-action-types

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2017-10-12
- 1.0.5 — 2017-10-10
- 1.0.4 — 2017-10-09
- 1.0.3 — 2017-10-09
- 1.0.2 — 2017-10-09
- 1.0.1 — 2017-10-09
- 1.0.0 — 2017-10-08

## README

# redux-crud-action-types
A simple lib help your define redux action type in easy way.  
Create unique names for example:
```
export const USER = create('user') // @crud/pending/id0/user, @crud/success/id0/user, @crud/error/id0/user
export const USER_SECOND = create('user') // @crud/pending/id1/user, @crud/success/id1/user, @crud/error/id1/user
```

[![Build Status](https://api.travis-ci.org/edtoken/redux-crud-action-types.svg?branch=master)](https://travis-ci.org/edtoken/redux-crud-action-types)

[![NPM](https://nodei.co/npm/redux-crud-action-types.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/redux-crud-action-types/)

[![NPM](https://nodei.co/npm-dl/redux-crud-action-types.png?height=3)](https://nodei.co/npm/redux-crud-action-types/)


## Install
```
npm install redux-crud-action-types --save
```

## Usage

### Action types before
```
// actionTypes.js
export const USER_PENDING = 'USER_PENDING'
export const USER_SUCCESS = 'USER_SUCCESS'
export const USER_ERROR = 'USER_ERROR'

```

### Action types after
```
// actionTypes.js

import {create} from 'redux-crud-action-types'

export const USER = create('USER')

```


### Reducer before
```
//reducer.js 

import { USER_ERROR, USER_PENDING, USER_SUCCESS } from './actionTypes'

export const reducer = (state, action) => {
  switch (action.type) {
    case USER_PENDING:
      //
      break
    case USER_SUCCESS:
      //
      break
    case USER_ERROR:
      //
      break
  }
  return state
}
```

### Reducer after
about 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)
 
```
//reducer.js 

import { USER } from './actionTypes'

export const reducer = (state, action) => {
  switch (action.type) {
    case USER: // or case USER.PENDING
      //
      break
    case USER.SUCCESS:
      //
      break
    case USER.ERROR:
      //
      break
  }
  return state
}

```

---
_Source: https://npm.io/package/redux-crud-action-types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
