redux-action-type-validator

1.1.0 • Public • Published

npm version Build Status codecov Dependency Status devDependency Status

redux-action-type-validator

Type validator for redux actions

Installation

npm i --save redux-action-type-validator

Usage

import {list, String} from "tcomb";
 
const typeofAction = actionTypeValidator(list(String));
 
export function action (payload) {
    typeofSelectSite(...arguments);
    return {
        type: "ACTION_TYPE",
        payload
    };
}
 
// Somewhere in your code
action(["some", "string", "here"]); // not throw
 
action("some"); // throw
 
 

Package Sidebar

Install

npm i redux-action-type-validator

Weekly Downloads

2

Version

1.1.0

License

Apache-2.0

Last publish

Collaborators

  • davidebianchi