# redux-pure-form

> Actions and reducers for redux

Latest version **2.0.4** (published 2018-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-pure-form
pnpm add redux-pure-form
yarn add redux-pure-form
bun add redux-pure-form
```

## 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 | 2.0.4 |
| Published | 2018-03-14 |
| First published | 2016-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Max Mykhailenko |
| Maintainers | max.mykhailenko |
| Keywords | redux, form |

## Links

- npm: https://www.npmjs.com/package/redux-pure-form
- Repository: https://github.com/max-mykhailenko/redux-pure-form
- Homepage: https://github.com/max-mykhailenko/redux-pure-form#readme
- Issues: https://github.com/max-mykhailenko/redux-pure-form/issues
- npm.io page: https://npm.io/package/redux-pure-form

## 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

- 2.0.4 (latest) — 2018-03-14
- 2.0.2 — 2018-01-17
- 2.0.1 — 2018-01-17
- 2.0.0 — 2018-01-17
- 1.3.1 — 2017-07-14
- 1.3.0 — 2017-07-13
- 1.2.11 — 2017-03-17
- 1.2.10 — 2016-12-19
- 1.2.9 — 2016-12-15
- 1.2.8 — 2016-12-12
- 1.2.7 — 2016-11-30
- 1.2.6 — 2016-11-30
- 1.2.5 — 2016-11-30
- 1.2.4 — 2016-11-30
- 1.2.3 — 2016-11-29
- … 6 more at https://npm.io/package/redux-pure-form/versions

## README

# redux-pure-form  [![npm package](https://img.shields.io/npm/v/redux-pure-form.svg?style=flat-square)](https://www.npmjs.org/package/redux-pure-form) [![Build Status](https://travis-ci.org/memCrab/redux-pure-form.svg?branch=master)](https://travis-ci.org/memCrab/redux-pure-form) [![Dependency Status](https://david-dm.org/memCrab/redux-pure-form.svg)](https://david-dm.org/memCrab/redux-pure-form)

Redux actions for good performance and hight integration with your reducers
- Very small (less than 4Kb)
- Without dependencies
- Use your current react-redux `connect`
- Don't create react-redux connection for each field
- Can by highly customizable

## Installation
`npm i -S redux-pure-form`

## Usage
```jsx
import { formActions, mergeActionsToProps, formReducer } from '../dist/redux-pure-form.min.js';

class Example extends Component {
  render() {
    return (
      <form>
        <input
          type="text"
          // add field name attr
          name="user.name"
          // add field value attr
          value={this.props.user.name}
          // add handlers from form
          {...this.props.fieldAttrs}
        />
        <select
          value={this.props.user.gender}
          name="user.gender"
          {...this.props.fieldAttrs}
        >
          <option value="male">male</option>
          <option value="female">female</option>
        </select>
        <label>
          <input
            type="checkbox"
            name="user.checkboxes[]"
            checked={this.props.user.checkboxes.includes('1')}
            value="1"
            {...this.props.fieldAttrs}
          />
          First checkbox
        </label>
        <br />
        <label>
          <input
            type="checkbox"
            name="user.checkboxes[]"
            checked={this.props.user.checkboxes.includes('2')}
            value="2"
            {...this.props.fieldAttrs}
          />
          Second one
        </label>
      </form>
    );
  }
}

// ...

const formNameReducer = formReducer('formName');

function firstReducer(state = {}, action) {
  switch (action.type) {
    default:
      // add form reducer as default reducer
      return formNameReducer(state, action);
  }
}

// ...

// add mergeActionsToProps as third argument
const Connected = connect(mapStateToProps, formActions, mergeActionsToProps)(Example);

```

## No Additional Settings Yet

## Changelog (latest on top)
   - Breaking: checkbox values `'1'` and `'true'` will be converted to `1` and `true` respectively
   - add array support
   - change reducer API
   - first release

## Developing
   - `npm install`
   - `npm run webpack:dev -- --watch`
   - `npm run webpack:prod -- --watch`
   - Open `index.html` and `example.js` from examples

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