# async-redux-helpers

> Opinionated helper functions to help reduce the amount of boilerplate code required to write async actions/reducers in redux applications

Latest version **1.1.0** (published 2019-05-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install async-redux-helpers
pnpm add async-redux-helpers
yarn add async-redux-helpers
bun add async-redux-helpers
```

## 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.1.0 |
| Published | 2019-05-06 |
| First published | 2018-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Levi Fuller |
| Maintainers | lfuller941 |
| Keywords | redux, helper, functions |

## Links

- npm: https://www.npmjs.com/package/async-redux-helpers
- Repository: https://github.com/ChuckkNorris/redux-helpers
- Homepage: https://github.com/ChuckkNorris/redux-helpers#readme
- Issues: https://github.com/ChuckkNorris/redux-helpers/issues
- npm.io page: https://npm.io/package/async-redux-helpers

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2019-05-06
- 1.0.0 — 2019-05-04
- 0.0.6 — 2018-09-20
- 0.0.4 — 2018-07-11
- 0.0.3 — 2018-07-11
- 0.0.2 — 2018-07-11
- 0.0.1 — 2018-07-11

## README

# Async Redux Helpers
Pure functions to simplify the creation of actions, async actions, reducers, and async reducers

Currently supports Fetch/Axios async requests

## Installation
`npm install async-redux-helpers` or `yarn add async-redux-helpers`

## Example

```
import {createAction, createReducer, createAsyncFetchAction, createAsyncReducer } from 'async-redux-helpers'

// Basic Action
const openDogModal = (breed) => createAction('OPEN_DOG_MODAL', {breed});

// Basic Reducer
const dogModalReducer = () => createReducer(
  // initial state
  {isOpen: false, breed: undefined},
  {
    'OPEN_DOG_MODAL': (state, action) => ({
      isOpen: true,
      breed: action.breed
    }),
    'CLOSE_DOG_MODAL': (state, action) => ({
      ...state
      isOpen: false
    })
  }
});

// Create an async action
const fetchDogBreedImage = (breed) => createAsyncFetchAction(
  'FETCH_DOG_BREED',
  () => fetch(`https://dog.ceo/api/breed/${breed}/image/random`),
  { breed }
);

// Create an async reducer to handle the action
const dogBreedReducer = createAsyncReducer('FETCH_DOG_BREED')

```

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