# create-action

> Helpers for creating FSA compatible actions

Latest version **0.2.1** (published 2015-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install create-action
pnpm add create-action
yarn add create-action
bun add create-action
```

## 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.2.1 |
| Published | 2015-09-24 |
| First published | 2015-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nikita Gusakov |
| Maintainers | nkt |
| Keywords | flux, action, fsa, redux |

## Links

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

## Alternatives

- [@reckona/mreact-store](https://npm.io/package/@reckona/mreact-store.md) — 976 weekly downloads
- [regular-state](https://npm.io/package/regular-state.md) — 410 weekly downloads
- [@pacote/flux-actions](https://npm.io/package/@pacote/flux-actions.md) — 65 weekly downloads
- [@pilotlab/lux-debug](https://npm.io/package/@pilotlab/lux-debug.md) — 39 weekly downloads
- [vue-persist-state](https://npm.io/package/vue-persist-state.md) — 19 weekly downloads

## Recent versions

- 0.2.1 (latest) — 2015-09-24
- 0.2.0 — 2015-09-24
- 0.1.1 — 2015-09-24
- 0.1.0 — 2015-09-24

## README

# Create Action

Helpers for creating FSA compatible actions.

## Installation

```
npm install --save create-action
```

## Usage

### Simple action creator:

```js
const {createAction} = require('create-action');

function addTodo(todo) {
  return createAction('ADD_TODO', todo);
}
```

Async action creator:

```js
const {createAsyncAction} = require('create-action');

function createTodo(todo) {
  return createAsyncAction(
    'CREATE_TODO',
    api.createTodo(todo)
  );
}
```

Async action creator with multiple dispatch:

```js
const {createAsyncAction} = require('create-action');

function fetch() {
  return createAsyncAction(
    'FETCH_USER',
    api.fetchUser()
  );
}

function login(data) {
  return createAsyncAction(
    'LOGIN',
    api.login(data).then(() => {
      return fetch();
    })
  );
}
```

## License
[MIT](LICENSE)

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