# redux-actiontypes-namespace

> add nameSpaces to your global actionTypes in an easy way

Latest version **0.1.1** (published 2018-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-actiontypes-namespace
pnpm add redux-actiontypes-namespace
yarn add redux-actiontypes-namespace
bun add redux-actiontypes-namespace
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2018-05-18 |
| First published | 2018-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 109.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Diel Duarte |
| Maintainers | dielduarte |

## Links

- npm: https://www.npmjs.com/package/redux-actiontypes-namespace
- Repository: https://github.com/dielduarte/redux-actionTypes-namespace
- Homepage: https://github.com/dielduarte/redux-actionTypes-namespace#readme
- Issues: https://github.com/dielduarte/redux-actionTypes-namespace/issues
- npm.io page: https://npm.io/package/redux-actiontypes-namespace

## Recent versions

- 0.1.1 (latest) — 2018-05-18
- 0.1.0 — 2018-05-18

## README

# redux-actionTypes-namespace
Add nameSpaces to your global actionTypes in an easy way

## How to use 

First install

```js
yarn add redux-actionTypes-namespace
```

import `createActionTypes` function, example:

```js
import createActionTypes from 'redux-actionTypes-namespace';

const actionTypes = [
  {
    nameSpace: 'nameSpace1',
    types: [
      'TYPE_NAME',
      'ANOTHER_TYPE'
    ]
  },
  {
    nameSpace: 'nameSpace2',
    types: [
      'SECOND_TYPE_NAME',
      'SECOND_ANOTHER_TYPE'
    ]
  }
];

export default createActionTypes(actionTypes);

```

now your actionTypes shoud be like:

```
  {
    TYPE_NAME: 'nameSpace1/TYPE_NAME',
    ANOTHER_TYPE: 'nameSpace1/ANOTHER_TYPE',
    SECOND_TYPE_NAME: 'nameSpace2/SECOND_TYPE_NAME',
    SECOND_ANOTHER_TYPE: 'nameSpace2/SECOND_ANOTHER_TYPE'
  }
```

So, now just import your actionTypes and you can use in a normal way.

```
 import types from 'where-your-file-was-created';

 dispatch({ type: types.TYPE_NAME })

```

or with object destructuring:

```
 import { TYPE_NAME } from 'where-your-file-was-created';

 dispatch({ type: TYPE_NAME })

```

made with <3

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