# redux-fx

> A library for managing side effect for Redux, inspired by the Elm Architecture.

Latest version **1.0.12** (published 2016-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-fx
pnpm add redux-fx
yarn add redux-fx
bun add redux-fx
```

## 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.12 |
| Published | 2016-03-23 |
| First published | 2016-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | doodledood |
| Maintainers | doodledood |
| Keywords | node, redux, javascript, react, elm |

## Links

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

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.6.1
- [babel-polyfill](https://npm.io/package/babel-polyfill.md) ^6.7.4

## 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.12 (latest) — 2016-03-23
- 1.0.11 — 2016-03-23
- 1.0.10 — 2016-03-23
- 1.0.9 — 2016-03-23
- 1.0.8 — 2016-03-23
- 1.0.7 — 2016-03-23
- 1.0.6 — 2016-03-23
- 1.0.5 — 2016-03-23
- 1.0.4 — 2016-03-23
- 1.0.3 — 2016-03-23
- 1.0.2 — 2016-03-23
- 1.0.1 — 2016-03-23
- 1.0.0 — 2016-03-23
- 0.1.0 — 2016-03-22

## README

<big><h1 align="center">redux-fx</h1></big>

<p align="center">
  <a href="https://npmjs.org/package/redux-fx">
    <img src="https://img.shields.io/npm/v/redux-fx.svg?style=flat-square"
         alt="NPM Version">
  </a>

  <a href="https://coveralls.io/r/doodledood/redux-fx">
    <img src="https://img.shields.io/coveralls/doodledood/redux-fx.svg?style=flat-square"
         alt="Coverage Status">
  </a>

  <a href="https://travis-ci.org/doodledood/redux-fx">
    <img src="https://img.shields.io/travis/doodledood/redux-fx.svg?style=flat-square"
         alt="Build Status">
  </a>

  <a href="https://npmjs.org/package/redux-fx">
    <img src="http://img.shields.io/npm/dm/redux-fx.svg?style=flat-square"
         alt="Downloads">
  </a>

  <a href="https://david-dm.org/doodledood/redux-fx.svg">
    <img src="https://david-dm.org/doodledood/redux-fx.svg?style=flat-square"
         alt="Dependency Status">
  </a>

  <a href="https://github.com/doodledood/redux-fx/blob/master/LICENSE">
    <img src="https://img.shields.io/npm/l/redux-fx.svg?style=flat-square"
         alt="License">
  </a>
</p>

<p><big>
A library for managing side effects for Redux, inspired by the Elm Architecture.
</big></p>


## Install

```sh
npm install redux-fx
```

## Usage

```js
import {enhanceStoreWithEffects, fx} from "redux-fx"

...

// Decorate createStore with enhanceStoreWithEffects to enable support for effects 
// NOTE: the enhancer HAS to come last in order for other enhancers to work
const createStoreWithMiddleware = compose(
  applyMiddleware(someMiddleware),
  devTools(),
  enhanceStoreWithEffects()
)(createStore);

...

// Create effects of signature (any) => (dispatch, getState) => (any)
const incrementWithDelay = seconds => dispatch => setTimeout(() => dispatch({type: "INCREMENT"}), seconds * 1000);

...

// Return a [state,effect] tuple to create effect descriptors that are fully testable.
const reducer = (state, action) => {
  switch (action.type) {
    case "INCREMENT":
      return [{count: state.count + 1}, fx(incrementWithDelay, 1)];
    case "DECREMENT":
      return {count: state.count - 1};
    default:
      return state;
  }
};

```

## License

MIT © [doodledood](http://github.com/doodledood)

[npm-url]: https://npmjs.org/package/redux-fx
[npm-image]: https://img.shields.io/npm/v/redux-fx.svg?style=flat-square

[travis-url]: https://travis-ci.org/doodledood/redux-fx
[travis-image]: https://img.shields.io/travis/doodledood/redux-fx.svg?style=flat-square

[coveralls-url]: https://coveralls.io/r/doodledood/redux-fx
[coveralls-image]: https://img.shields.io/coveralls/doodledood/redux-fx.svg?style=flat-square

[depstat-url]: https://david-dm.org/doodledood/redux-fx
[depstat-image]: https://david-dm.org/doodledood/redux-fx.svg?style=flat-square

[download-badge]: http://img.shields.io/npm/dm/redux-fx.svg?style=flat-square

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