# react-forml-redux

> Ruthlessly simple bindings to keep react-forml and redux in sync

Latest version **0.1.2** (published 2017-04-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-forml-redux
pnpm add react-forml-redux
yarn add react-forml-redux
bun add react-forml-redux
```

## 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.2 |
| Published | 2017-04-04 |
| First published | 2017-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | rosendi |

## Links

- npm: https://www.npmjs.com/package/react-forml-redux
- Repository: https://github.com/postform/react-forml-redux
- Homepage: https://postform.io
- Issues: https://github.com/postform/react-forml-redux/issues
- npm.io page: https://npm.io/package/react-forml-redux

## Recent versions

- 0.1.2 (latest) — 2017-04-04
- 0.1.1 — 2017-03-23
- 0.1.0 — 2017-02-23

## README

## Table of Contents

- [Installation](#installation)
- [Usage](#license)
- [License](#license)
- [About](#about)

## Installation

```yarn add react-forml-redux```

## Usage

Run the saga:

```
import { saga } from 'react-forml-redux';

// Run it.
```
Then there are two options:

### Option 1:

In your container:

```
import { bindSubmitFormToPromise } from 'react-forml-redux';
import { signin } from './creators';
import { SIGNIN_SUCCESS, SIGNIN_FAILURE } from './actions';

class SigninFormContainer extends Component {
  onSubmit = ({ email, password }) => {
    const { signin: signinDispatch } = this.props;

    return signinDispatch(email, password); // It's a promise.
  }
}

const mapDispatchToProps = dispatch => ({
  signin: bindSubmitFormToPromise(signin, SIGNIN_SUCCESS, SIGNIN_FAILURE, dispatch),
});

export default connect(null, mapDispatchToProps)(withRouter(SigninFormContainer));
```

### Option 2

In your creator:

```
function signin(payload) {
  type: SIGNIN_REQUEST,
  payload,
  meta: {
    successAction: SIGNIN_SUCCESS,
    failureAction: SIGNIN_FAILURE,
  },
}
```

Then in your container:

```
import { bindSubmitFormToPromise } from 'react-forml-redux';
import { signin } from './creators';

class SigninFormContainer extends Component {
  onSubmit = ({ email, password }) => {
    const { signin: signinDispatch } = this.props;

    return signinDispatch(email, password); // It's a promise.
  }
}

const mapDispatchToProps = dispatch => ({
  signin: bindSubmitFormToPromise(signin, dispatch),
});

export default connect(null, mapDispatchToProps)(withRouter(SigninFormContainer));
```

## License

© 2017 [Postform, Inc.](https://postform.io)

It is free software, and may be redistributed under the terms specified in the (license)[LICENSE].

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