1.0.1 • Published 5 years ago

@jeemyeong/redux-intercept v1.0.1

Weekly downloads
-
License
Unlicense
Repository
github
Last release
5 years ago

redux-intercept npm version

redux-intercept is a Redux middleware for user to control specific actions

Features

  • Written in TypeScript.

Installation

$ npm i @jeemyeong/redux-intercept

Configuration

import { applyMiddleware, compose, createStore } from 'redux';
import reduxIntercept from '@jeemyeong/redux-intercept';

import reducer from './store/reducer';

const interceptOption = {
  filter: (action) => {
    return !action.type.match(PERMIT_REGEX)
  }
}


// Create the Redux store.
const store = createStore(
  reducer,
  applyMiddleware(reduxIntercept(interceptOption))
);

You should pass options to the reduxIntercept function.

Available options

interface Options {
  filter: (action: Action) => boolean | Promise<boolean>;
  rejectedCallback?: (action: Action) => void;
}
1.0.1

5 years ago

1.0.0

5 years ago