Skip to content

Create redux actions and validate their payload. Can be used next to redux-actions library.

Notifications You must be signed in to change notification settings

cweise/redux-valacts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@cweise/redux-valacts

redux-valacts is a small companion library to create flux like redux-actions with a validation schema.

Install

npm i @cweise/redux-valacts yup --save
yarn add @cweise/redux-valacts yup

Usage

import { object, string } from "yup";
import { createAction } from "@cweise/redux-valacts";

const validationSchema = object({
  username: string().required(),
  password: string()
});

const login = createAction("LOGIN", { validationSchema });

// This will throw an error because username is required
login({
  username: "",
  password: "XXX"
});

About

Create redux actions and validate their payload. Can be used next to redux-actions library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published