https://github.com/pem--/simpl-schema-to-redux-form
SimpleSchema to Redux Form
https://github.com/pem--/simpl-schema-to-redux-form
redux-form simpl-schema
Last synced: 4 months ago
JSON representation
SimpleSchema to Redux Form
- Host: GitHub
- URL: https://github.com/pem--/simpl-schema-to-redux-form
- Owner: PEM--
- License: mit
- Created: 2017-07-20T13:01:23.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-17T16:38:53.000Z (almost 8 years ago)
- Last Synced: 2025-03-26T22:03:17.566Z (4 months ago)
- Topics: redux-form, simpl-schema
- Language: JavaScript
- Size: 291 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# simpl-schema-to-redux-form
[](https://github.com/facebook/jest)


[](https://standardjs.com)SimpleSchema to Redux Form
## Installation
```
yarn add simpl-schema-to-redux-form
```## Create a validation context
```
import SimpleSchema from 'simpl-schema'
import { simpleSchemaToReduxFormValidator } from 'simpl-schema-to-redux-form'// Create your own schema
const schema = new SimpleSchema({ ... })// Create a validation context for this schema
const ctx = mainSchema().newContext()// Create your validate function for redux-form
const validate = simpleSchemaToReduxFormValidator(ctx)
```## Current values and validation state
The created `validate` function exposes 2 members: `values`, `errors`.## Add logger
In development, you can log each call to the validation function by passing a logger.```
const validate = simpleSchemaToReduxFormValidator(ctx, console)
```