Skip to content

PEM--/simpl-schema-to-redux-form

Repository files navigation

simpl-schema-to-redux-form

tested with jest license dependencies JavaScript Style Guide

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)

About

SimpleSchema to Redux Form

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published