redux-action-type-validator
v1.1.0
Published
Type validator for redux actions
Downloads
4
Maintainers
Readme
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