Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@meadow/redux-ensure-fsa

2.0.0 • Public • Published

Redux Ensure Flux Standard Action Middleware

redux-ensure-fsa provides a middleware function to use as part of the redux dispatch chain. It is intended for use in development only to check that all actions at the end of the chain follow the Flux Standard Action protocol.

Installation

npm install @meadow/redux-ensure-fsa

Usage

import { createStore, applyMiddleware } from 'redux';
import ensureFSAMiddleware from '@meadow/redux-ensure-fsa';
import thunkMiddleware from 'redux-thunk';
 
let middleware = [thunkMiddleware];
 
if (process.env.NODE_ENV !== 'production') {
  const fsaMiddleware = ensureFSAMiddleware({
    ignore: function (action) {
      return false;
    }
  })
 
  middleware = [...middleware, fsaMiddleware];
}
 
const createStoreWithMiddleware = applyMiddleware(...middleware)(createStore);

ghit.me

Install

npm i @meadow/redux-ensure-fsa

DownloadsWeekly Downloads

14

Version

2.0.0

License

MIT

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar