Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

redux-validate-fsa

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Issues
File Explorer

Advanced tools

redux-validate-fsa

Redux middleware that validates if an action is a Flux Standard Action (FSA)

    0.1.2latest
    Github

Version published
Maintainers
1
Weekly downloads
178
decreased by-45.23%

Weekly downloads

Readme

Source

redux-validate-fsa

NPM

Build Status

Redux middleware that validates if an action is a Flux Standard Action (FSA).

Usage

const middleware = [reduxThunk] // Only use in DEV mode if (__DEV__) { const fsaMiddleware = require('redux-validate-fsa')(ignore /* optional */) middleware.push(fsaMiddleware) }

The ignore argument specify actions that should be skipped from the FSA check. This is useful when dealing with non-compliant actions from third-party libraries.

  • If an array is given, it is the action types that should be skipped from the FSA check.
  • If a function is given, it must return true for actions that should be skipped from the FSA check.

For example, if you use redux-simple-router, you should ignore its update-path actions, which are not FSA compliant.

import {UPDATE_PATH} from 'redux-simple-router' const fsaMiddleware = require('redux-validate-fsa')([UPDATE_PATH])

Notes:

  • This middleware is only useful in dev mode. Therefore, it should be conditionally imported.
  • If you use redux-thunk, make sure the thunk middleware is added before this middleware. Alternatively, you can use the ignore predicate to filter out actions that are thunks.

Test

npm install npm test

Keywords

FAQs

Last updated on 24 Nov 2015

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc