Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/memcrab/redux-pure-form

Redux actions for good performance and hight integration with your reducers
https://github.com/memcrab/redux-pure-form

form reducers redux

Last synced: about 1 month ago
JSON representation

Redux actions for good performance and hight integration with your reducers

Awesome Lists containing this project

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 (



male
female



First checkbox





Second one


);
}
}

// ...

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