5.9.1-beta.2 • Published 5 days ago

redux-freeform v5.9.1-beta.2

Weekly downloads
279
License
MIT
Repository
github
Last release
5 days ago

header

Build Status

Read the Docs!

What?

Freeform is a library that generates form management reducers for you. It handles validation and provides state information for you to render as you like. Freeform is renderless which is to say it makes no decisions for how you display the form state. As such it does not necessarily depend upon React and could in theory be used with Angular or any other view library you're using with redux.

Freeform supports a functional all-in approach to Redux apps. There are many benefits to keeping all your state in Redux but it can be tedious to write out all the reducers and actions. By generating form reducers from simple configs we make this much more manageable.

Freeform takes a form configuration object and generates a mapStateToProps, mapDispatchToProps, and reducer for you to use at your leisure.

Why?

There are a lot of redux form management libraries. Some of those may suit your needs better. This library will be of use to you if you want your app to contain a single source of truth for app state and you want full flexibility in your rendering.

Example Usage

Check the /examples folder for runnable examples. But here's what the API looks like:

import {
  createFormState,
  matchesField,
  numberLessThan,
  onlyIntegers,
  required
} from "redux-freeform";

const formConfig = {
  age: {
    validators: [required(), onlyIntegers(), numberLessThan(99)]
  },
  name: {
    validators: [required()]
  },
  confirmName: {
    validators: [required(), matchesField("name")]
  },
  country: {
    defaultValue: "U.S.",
    validators: [required()]
  }
};

const { reducer, mapStateToProps, mapDispatchToProps } = createFormState(
  formConfig
);

Testing

Ava is the test runner for Redux Freeform.

  • To run tests locally: yarn run test
  • To check test coverage locally: yarn run coverage
5.9.1-beta.2

5 days ago

5.9.1-beta.0

6 days ago

5.9.0

29 days ago

5.9.0-beta.2

1 month ago

5.9.0-beta.0

2 months ago

5.9.0-beta.1

2 months ago

5.8.2-beta.0

7 months ago

5.8.2-beta.1

7 months ago

5.8.2-beta.2

7 months ago

5.8.2-beta.3

7 months ago

5.8.2-beta.4

7 months ago

5.8.2-beta.5

7 months ago

5.8.2-beta.6

7 months ago

5.8.2-beta.7

7 months ago

5.8.2-beta.8

7 months ago

5.8.2-beta.9

7 months ago

5.8.1

10 months ago

5.7.0-beta.0

1 year ago

5.8.0-beta.2

12 months ago

5.8.0-beta.3

12 months ago

5.8.0-beta.0

1 year ago

5.8.0-beta.1

12 months ago

5.8.0

12 months ago

5.7.0

1 year ago

5.6.0

2 years ago

5.6.0-beta.4

2 years ago

5.6.0-beta.1

2 years ago

5.6.0-beta.0

2 years ago

5.6.0-beta.3

2 years ago

5.6.0-beta.2

2 years ago

5.5.0

2 years ago

5.4.0

2 years ago

5.3.0

2 years ago

5.4.0-beta.0

2 years ago

5.2.0

3 years ago

5.1.0

3 years ago

5.1.0-beta.0

3 years ago

5.1.0-beta.1

3 years ago

5.1.0-beta.2

3 years ago

5.1.0-beta.7

3 years ago

5.1.0-beta.3

3 years ago

5.1.0-beta.4

3 years ago

5.1.0-beta.5

3 years ago

5.1.0-beta.6

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.1.4

4 years ago

4.1.3

4 years ago

4.1.2

4 years ago

4.1.1

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.1.0

4 years ago

3.0.0

5 years ago

2.0.0

5 years ago

1.0.0

5 years ago

0.0.3

5 years ago