Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 26 days 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 (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-17T16:38:53.000Z (over 7 years ago)
- Last Synced: 2024-11-28T07:06:30.084Z (about 1 month ago)
- Topics: redux-form, simpl-schema
- Language: JavaScript
- Size: 291 KB
- Stars: 2
- Watchers: 2
- 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
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)
![license](https://img.shields.io/github/license/mashape/apistatus.svg)
![dependencies](https://img.shields.io/david/PEM--/simpl-schema-to-redux-form.svg)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](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)
```