Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/memcrab/redux-pure-form
- Owner: Memcrab
- License: mit
- Created: 2016-11-13T18:48:01.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-12-11T11:01:23.000Z (about 5 years ago)
- Last Synced: 2024-11-14T05:14:06.220Z (about 2 months ago)
- Topics: form, reducers, redux
- Language: JavaScript
- Size: 681 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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