simpl-schema-to-redux-form

1.0.1 • Public • Published

simpl-schema-to-redux-form

tested with jest license dependencies JavaScript Style Guide

SimpleSchema 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)

Readme

Keywords

none

Package Sidebar

Install

npm i simpl-schema-to-redux-form

Weekly Downloads

5

Version

1.0.1

License

MIT

Last publish

Collaborators

  • pem