@jeemyeong/redux-intercept
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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;
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i @jeemyeong/redux-intercept

Weekly Downloads

0

Version

1.0.1

License

Unlicense

Unpacked Size

12.4 kB

Total Files

11

Last publish

Collaborators

  • jeemyeong