Skip to content

Initial Release

Compare
Choose a tag to compare
@beeeth beeeth released this 11 May 19:55
· 5 commits to master since this release
c75dbf9

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.

Initial Features

  • createFormState function that returns { reducer, mapStateToProps, mapDispatchToProps }
  • support for validators array in formConfig
  • support for constraints array in formConfig
  • support for defaultValue array in formConfig
  • dirty flag in generated formState
  • rawValue field in generated formState
  • validators array in generated formState
  • constraints array in generated formState
  • errors array in generated formState
  • hasErrors flag in generated formState
  • error constants exposed on validator creator functions
  • API documentation hosted at https://citybaseinc.github.io/redux-freeform/docs/create-form-state